ปิด validate
This commit is contained in:
parent
b98d69ad96
commit
f05e2fef55
1 changed files with 27 additions and 27 deletions
|
|
@ -124,20 +124,20 @@ export class OrganizationController extends Controller {
|
|||
@Request() request: RequestWithUser,
|
||||
) {
|
||||
try {
|
||||
// CheckQueueInProgress
|
||||
const [isBusyDraft, isBusyPublish] = await Promise.all([
|
||||
checkQueueInProgress(`${process.env.AMQ_QUEUE_ORG_DRAFT}`),
|
||||
checkQueueInProgress(`${process.env.AMQ_QUEUE_ORG}`),
|
||||
]);
|
||||
// console.log("✅ ตรวจสอบแล้ว Draft Busy:", isBusyDraft);
|
||||
// console.log("✅ ตรวจสอบแล้ว Publish Busy:", isBusyPublish);
|
||||
if (isBusyDraft || isBusyPublish) {
|
||||
// console.log("🚫 พบว่ามีงานอยู่ในคิว — error")
|
||||
throw new HttpError(
|
||||
HttpStatusCode.CONFLICT,
|
||||
"ไม่สามารถดำเนินการได้ หากกำลังเผยแพร่หรือสร้างแบบร่างโครงสร้างหน่วยงาน",
|
||||
);
|
||||
}
|
||||
// // CheckQueueInProgress
|
||||
// const [isBusyDraft, isBusyPublish] = await Promise.all([
|
||||
// checkQueueInProgress(`${process.env.AMQ_QUEUE_ORG_DRAFT}`),
|
||||
// checkQueueInProgress(`${process.env.AMQ_QUEUE_ORG}`),
|
||||
// ]);
|
||||
// // console.log("✅ ตรวจสอบแล้ว Draft Busy:", isBusyDraft);
|
||||
// // console.log("✅ ตรวจสอบแล้ว Publish Busy:", isBusyPublish);
|
||||
// if (isBusyDraft || isBusyPublish) {
|
||||
// // console.log("🚫 พบว่ามีงานอยู่ในคิว — error")
|
||||
// throw new HttpError(
|
||||
// HttpStatusCode.CONFLICT,
|
||||
// "ไม่สามารถดำเนินการได้ หากกำลังเผยแพร่หรือสร้างแบบร่างโครงสร้างหน่วยงาน",
|
||||
// );
|
||||
// }
|
||||
//new main revision
|
||||
const before = null;
|
||||
const revision = Object.assign(new OrgRevision(), requestBody) as OrgRevision;
|
||||
|
|
@ -3209,19 +3209,19 @@ export class OrganizationController extends Controller {
|
|||
try {
|
||||
// CheckQueueInProgress
|
||||
// console.log("🚀 ตรวจสอบว่ามีงานอยู่ในคิว");
|
||||
const [isBusyDraft, isBusyPublish] = await Promise.all([
|
||||
checkQueueInProgress(`${process.env.AMQ_QUEUE_ORG_DRAFT}`),
|
||||
checkQueueInProgress(`${process.env.AMQ_QUEUE_ORG}`),
|
||||
]);
|
||||
// console.log("✅ ตรวจสอบแล้ว Draft Busy:", isBusyDraft);
|
||||
// console.log("✅ ตรวจสอบแล้ว Publish Busy:", isBusyPublish);
|
||||
if (isBusyDraft || isBusyPublish) {
|
||||
// console.log("🚫 พบว่ามีงานอยู่ในคิว — error")
|
||||
throw new HttpError(
|
||||
HttpStatusCode.CONFLICT,
|
||||
"ไม่สามารถดำเนินการได้ หากกำลังเผยแพร่หรือสร้างแบบร่างโครงสร้างหน่วยงาน",
|
||||
);
|
||||
}
|
||||
// const [isBusyDraft, isBusyPublish] = await Promise.all([
|
||||
// checkQueueInProgress(`${process.env.AMQ_QUEUE_ORG_DRAFT}`),
|
||||
// checkQueueInProgress(`${process.env.AMQ_QUEUE_ORG}`),
|
||||
// ]);
|
||||
// // console.log("✅ ตรวจสอบแล้ว Draft Busy:", isBusyDraft);
|
||||
// // console.log("✅ ตรวจสอบแล้ว Publish Busy:", isBusyPublish);
|
||||
// if (isBusyDraft || isBusyPublish) {
|
||||
// // console.log("🚫 พบว่ามีงานอยู่ในคิว — error")
|
||||
// throw new HttpError(
|
||||
// HttpStatusCode.CONFLICT,
|
||||
// "ไม่สามารถดำเนินการได้ หากกำลังเผยแพร่หรือสร้างแบบร่างโครงสร้างหน่วยงาน",
|
||||
// );
|
||||
// }
|
||||
|
||||
const today = new Date();
|
||||
today.setHours(0, 0, 0, 0); // Set time to the beginning of the day
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue