wangqifan пре 2 година
родитељ
комит
fb0b9cbd9d
2 измењених фајлова са 8 додато и 2 уклоњено
  1. 2 2
      src/api-users/api-user.controller.ts
  2. 6 0
      src/api-users/entities/api-user.entity.ts

+ 2 - 2
src/api-users/api-user.controller.ts

@@ -11,7 +11,7 @@ import {
     Req,
     Post
 } from '@nestjs/common'
-import { HasRoles } from '../auth/roles.decorator'
+import { HasAnyRoles, HasRoles } from '../auth/roles.decorator'
 import { Role } from '../model/role.enum'
 import { ApiBearerAuth, ApiTags } from '@nestjs/swagger'
 import { PageRequest } from '../common/dto/page-request'
@@ -48,7 +48,7 @@ export class ApiUserController {
     }
 
     @Put('/:id')
-    @HasRoles(Role.Api)
+    @HasAnyRoles(Role.Api, Role.Admin)
     public async update(@Param('id') id: string, @Body() apiUser: ApiUser) {
         try {
             await this.apiUserService.update(Number(id), apiUser)

+ 6 - 0
src/api-users/entities/api-user.entity.ts

@@ -22,6 +22,12 @@ export class ApiUser {
     @Column()
     desc: string
 
+    @Column()
+    logo: string
+
+    @Column()
+    company: string
+
     @Column({ nullable: true })
     code: string