feat: create api to bulk update privileges
continuous-integration/drone/tag Build is passing
Details
continuous-integration/drone/tag Build is passing
Details
parent
84b829a7fa
commit
9815c667f0
|
@ -1,4 +1,4 @@
|
||||||
import { Body, Controller, Get, Param, Put, Query } from '@nestjs/common';
|
import { Body, Controller, Get, Put, Query } from '@nestjs/common';
|
||||||
import { ApiBearerAuth, ApiTags } from '@nestjs/swagger';
|
import { ApiBearerAuth, ApiTags } from '@nestjs/swagger';
|
||||||
import { ExcludePrivilege, Public } from 'src/core/guards';
|
import { ExcludePrivilege, Public } from 'src/core/guards';
|
||||||
import { MODULE_NAME } from 'src/core/strings/constants/module.constants';
|
import { MODULE_NAME } from 'src/core/strings/constants/module.constants';
|
||||||
|
@ -28,6 +28,19 @@ export class UserPrivilegeConfigurationController {
|
||||||
return await this.orchestrator.update(data);
|
return await this.orchestrator.update(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Put('/bulk')
|
||||||
|
async updateBulk(
|
||||||
|
@Body() datum: UserPrivilegeConfigurationDto[],
|
||||||
|
): Promise<UserPrivilegeConfigurationEntity[]> {
|
||||||
|
const results = [];
|
||||||
|
for (const data of datum) {
|
||||||
|
const result = await this.orchestrator.update(data);
|
||||||
|
results.push(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
return results;
|
||||||
|
}
|
||||||
|
|
||||||
@Get()
|
@Get()
|
||||||
@Pagination()
|
@Pagination()
|
||||||
async index(
|
async index(
|
||||||
|
|
Loading…
Reference in New Issue