fix api role

This commit is contained in:
AdisakKanthawilang 2024-06-11 18:27:54 +07:00
parent 543ef19664
commit ba065b4299
4 changed files with 71 additions and 20 deletions

View file

@ -31,9 +31,9 @@ export class AuthRoleAttrController extends Controller {
@Get("list")
public async listAuthRoleAttr() {
const getList = await this.authRoleAttrRepo.find();
if (!getList || getList.length === 0) {
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
}
// if (!getList || getList.length === 0) {
// throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
// }
return new HttpSuccess(getList);
}
@ -74,7 +74,7 @@ export class AuthRoleAttrController extends Controller {
await this.authRoleAttrRepo.save(data);
return new HttpSuccess();
return new HttpSuccess(data.id);
}
@Patch("{roleAttrId}")