parent
ee3975c934
commit
b7ae2e35a4
2 changed files with 64 additions and 18 deletions
|
|
@ -301,17 +301,8 @@ export class DevelopmentRequestController extends Controller {
|
|||
});
|
||||
if (!record) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
|
||||
await new permission().PermissionUpdate(req, "SYS_REGISTRY_OFFICER");
|
||||
const before = structuredClone(record);
|
||||
requestBody.status = requestBody.status.trim().toUpperCase();
|
||||
Object.assign(record, requestBody);
|
||||
|
||||
record.lastUpdateUserId = req.user.sub;
|
||||
record.lastUpdateFullName = req.user.name;
|
||||
record.lastUpdatedAt = new Date();
|
||||
|
||||
await this.developmentRequestRepository.save(record, { data: req });
|
||||
setLogDataDiff(req, { before, after: record });
|
||||
if (requestBody.status == "APPROVE") {
|
||||
|
||||
if (requestBody.status == "APPROVE" && record.status == "PENDING") {
|
||||
let profileDevelopment = new ProfileDevelopment();
|
||||
const meta = {
|
||||
createdUserId: req.user.sub,
|
||||
|
|
@ -368,7 +359,16 @@ export class DevelopmentRequestController extends Controller {
|
|||
);
|
||||
}
|
||||
}
|
||||
const before = structuredClone(record);
|
||||
requestBody.status = requestBody.status.trim().toUpperCase();
|
||||
Object.assign(record, requestBody);
|
||||
|
||||
record.lastUpdateUserId = req.user.sub;
|
||||
record.lastUpdateFullName = req.user.name;
|
||||
record.lastUpdatedAt = new Date();
|
||||
|
||||
await this.developmentRequestRepository.save(record, { data: req });
|
||||
setLogDataDiff(req, { before, after: record });
|
||||
return new HttpSuccess(record.id);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue