31 lines
1.1 KiB
TypeScript
31 lines
1.1 KiB
TypeScript
import { Body, Controller, Get, Param, Patch, Post, UseGuards } from '@nestjs/common';
|
|
import { ApiTags } from '@nestjs/swagger';
|
|
import { Roles } from 'src/decorators/roles.decorator';
|
|
import { JwtAuthGuard } from 'src/guards/jwt-auth.guard';
|
|
import { RolesGuard } from 'src/guards/roles.guard';
|
|
import { RegionService } from './region.service';
|
|
import { InsertRegionsDto, SPID_DTO, UpdateRegionDto } from 'src/dto/property.dto';
|
|
|
|
@ApiTags('Regions - PG')
|
|
@UseGuards(JwtAuthGuard, RolesGuard)
|
|
@Roles('psa', 'pua')
|
|
@Controller('2')
|
|
export class RegionController {
|
|
constructor(private readonly regionService: RegionService) { }
|
|
|
|
@Post('/InsertRegions')
|
|
insertRegions(@Body() body: InsertRegionsDto) {
|
|
return this.regionService.insertRegions(body);
|
|
}
|
|
|
|
@Patch('/UpdateRegion')
|
|
updateRegions(@Body() body: UpdateRegionDto) {
|
|
return this.regionService.updateRegions(body);
|
|
}
|
|
|
|
@Get('/GetRegions/:P_SPID')
|
|
getRegions(@Param() param: SPID_DTO) {
|
|
return this.regionService.getRegions(param);
|
|
}
|
|
}
|