admin
This commit is contained in:
@@ -52,7 +52,7 @@ export class AdminService {
|
|||||||
throw new NotFoundException('Admin not found');
|
throw new NotFoundException('Admin not found');
|
||||||
}
|
}
|
||||||
|
|
||||||
const { roleId, ...rest } = dto;
|
const { ...rest } = dto;
|
||||||
|
|
||||||
// Update scalar fields (firstName, lastName, phone)
|
// Update scalar fields (firstName, lastName, phone)
|
||||||
if (rest.firstName !== undefined) {
|
if (rest.firstName !== undefined) {
|
||||||
|
|||||||
@@ -1,13 +1,15 @@
|
|||||||
import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common';
|
import { Controller, Get, Post, Body, Patch, Param, Delete, UseGuards } from '@nestjs/common';
|
||||||
import { BusinessService } from './business.service';
|
import { BusinessService } from './business.service';
|
||||||
import { SetupBusinessDto } from './dto/create-business.dto';
|
import { SetupBusinessDto } from './dto/create-business.dto';
|
||||||
import { UpdateBusinessDto } from './dto/update-business.dto';
|
import { UpdateBusinessDto } from './dto/update-business.dto';
|
||||||
|
import { SuperAdminAuthGuard } from '../auth/guards/superAdminAuth.guard';
|
||||||
|
|
||||||
@Controller('business')
|
@Controller('business')
|
||||||
export class BusinessController {
|
export class BusinessController {
|
||||||
constructor(private readonly businessService: BusinessService) { }
|
constructor(private readonly businessService: BusinessService) { }
|
||||||
|
|
||||||
@Post()
|
@Post('setup')
|
||||||
|
@UseGuards(SuperAdminAuthGuard)
|
||||||
create(@Body() createBusinessDto: SetupBusinessDto) {
|
create(@Body() createBusinessDto: SetupBusinessDto) {
|
||||||
return this.businessService.setupAccount(createBusinessDto);
|
return this.businessService.setupAccount(createBusinessDto);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user