no message

This commit is contained in:
kittapath 2024-10-21 14:28:11 +07:00
parent 8d1d5cc45c
commit 6cfb660742

View file

@ -700,4 +700,35 @@ export class WorkflowController extends Controller {
let isOfficer = profileOfficer.orgChild1 == null ? false : profileOfficer.orgChild1.isOfficer;
return new HttpSuccess({ isOfficer: isOfficer, isStaff: !isOfficer });
}
/**
* API
*
* @summary
*
*/
@Post("keycloak/isofficer/{system}")
async checkPermissionWorkflow(
@Request() req: RequestWithUser,
@Body()
body: {
refId: string;
},
) {
const profile = await this.profileRepo.findOne({
where: {
keycloak: req.user.sub,
},
});
if (!profile) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลผู้ใช้งาน");
const profileOfficer = await this.workflowRepo.findOne({
where: {
states: { stateUserComments: { profile: { keycloak: req.user.sub } } },
refId: body.refId,
},
});
if (!profileOfficer) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลสิทธิ์");
return new HttpSuccess();
}
}