แก้ชื่อสิท

This commit is contained in:
JoolsoftAdmin 2024-08-13 10:25:58 +07:00
parent 828dd2a37d
commit ab138c2e04
23 changed files with 77 additions and 67 deletions

View file

@ -166,7 +166,7 @@ export class ProfileInsigniaController extends Controller {
@Post()
public async newInsignia(@Request() req: RequestWithUser, @Body() body: CreateProfileInsignia) {
await new permission().PermissionCreate(req,"SYS_REGISTRY");
await new permission().PermissionCreate(req, "SYS_REGISTRY_OFFICER");
if (!body.profileId) {
throw new HttpError(HttpStatus.BAD_REQUEST, "กรุณากรอก profileId");
}
@ -206,7 +206,7 @@ export class ProfileInsigniaController extends Controller {
@Body() body: UpdateProfileInsignia,
@Path() insigniaId: string,
) {
await new permission().PermissionUpdate(req,"SYS_REGISTRY");
await new permission().PermissionUpdate(req, "SYS_REGISTRY_OFFICER");
const record = await this.insigniaRepo.findOneBy({ id: insigniaId });
if (!record) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
@ -233,7 +233,7 @@ export class ProfileInsigniaController extends Controller {
@Delete("{insigniaId}")
public async deleteInsignia(@Path() insigniaId: string, @Request() req: RequestWithUser) {
await new permission().PermissionDelete(req,"SYS_REGISTRY");
await new permission().PermissionDelete(req, "SYS_REGISTRY_OFFICER");
await this.insigniaHistoryRepo.delete({
profileInsigniaId: insigniaId,
});
@ -248,7 +248,10 @@ export class ProfileInsigniaController extends Controller {
}
@Post("dump-db")
public async newInsigniaDumpDB(@Request() req: RequestWithUser, @Body() body: CreateProfileInsignia) {
public async newInsigniaDumpDB(
@Request() req: RequestWithUser,
@Body() body: CreateProfileInsignia,
) {
if (!body.profileId) {
throw new HttpError(HttpStatus.BAD_REQUEST, "กรุณากรอก profileId");
}
@ -276,7 +279,7 @@ export class ProfileInsigniaController extends Controller {
};
Object.assign(data, { ...body, ...meta });
data.insigniaId = insignia.id
data.insigniaId = insignia.id;
await this.insigniaRepo.save(data);
return new HttpSuccess();