ปิด 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,
|
@Request() request: RequestWithUser,
|
||||||
) {
|
) {
|
||||||
try {
|
try {
|
||||||
// CheckQueueInProgress
|
// // CheckQueueInProgress
|
||||||
const [isBusyDraft, isBusyPublish] = await Promise.all([
|
// const [isBusyDraft, isBusyPublish] = await Promise.all([
|
||||||
checkQueueInProgress(`${process.env.AMQ_QUEUE_ORG_DRAFT}`),
|
// checkQueueInProgress(`${process.env.AMQ_QUEUE_ORG_DRAFT}`),
|
||||||
checkQueueInProgress(`${process.env.AMQ_QUEUE_ORG}`),
|
// checkQueueInProgress(`${process.env.AMQ_QUEUE_ORG}`),
|
||||||
]);
|
// ]);
|
||||||
// console.log("✅ ตรวจสอบแล้ว Draft Busy:", isBusyDraft);
|
// // console.log("✅ ตรวจสอบแล้ว Draft Busy:", isBusyDraft);
|
||||||
// console.log("✅ ตรวจสอบแล้ว Publish Busy:", isBusyPublish);
|
// // console.log("✅ ตรวจสอบแล้ว Publish Busy:", isBusyPublish);
|
||||||
if (isBusyDraft || isBusyPublish) {
|
// if (isBusyDraft || isBusyPublish) {
|
||||||
// console.log("🚫 พบว่ามีงานอยู่ในคิว — error")
|
// // console.log("🚫 พบว่ามีงานอยู่ในคิว — error")
|
||||||
throw new HttpError(
|
// throw new HttpError(
|
||||||
HttpStatusCode.CONFLICT,
|
// HttpStatusCode.CONFLICT,
|
||||||
"ไม่สามารถดำเนินการได้ หากกำลังเผยแพร่หรือสร้างแบบร่างโครงสร้างหน่วยงาน",
|
// "ไม่สามารถดำเนินการได้ หากกำลังเผยแพร่หรือสร้างแบบร่างโครงสร้างหน่วยงาน",
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
//new main revision
|
//new main revision
|
||||||
const before = null;
|
const before = null;
|
||||||
const revision = Object.assign(new OrgRevision(), requestBody) as OrgRevision;
|
const revision = Object.assign(new OrgRevision(), requestBody) as OrgRevision;
|
||||||
|
|
@ -3209,19 +3209,19 @@ export class OrganizationController extends Controller {
|
||||||
try {
|
try {
|
||||||
// CheckQueueInProgress
|
// CheckQueueInProgress
|
||||||
// console.log("🚀 ตรวจสอบว่ามีงานอยู่ในคิว");
|
// console.log("🚀 ตรวจสอบว่ามีงานอยู่ในคิว");
|
||||||
const [isBusyDraft, isBusyPublish] = await Promise.all([
|
// const [isBusyDraft, isBusyPublish] = await Promise.all([
|
||||||
checkQueueInProgress(`${process.env.AMQ_QUEUE_ORG_DRAFT}`),
|
// checkQueueInProgress(`${process.env.AMQ_QUEUE_ORG_DRAFT}`),
|
||||||
checkQueueInProgress(`${process.env.AMQ_QUEUE_ORG}`),
|
// checkQueueInProgress(`${process.env.AMQ_QUEUE_ORG}`),
|
||||||
]);
|
// ]);
|
||||||
// console.log("✅ ตรวจสอบแล้ว Draft Busy:", isBusyDraft);
|
// // console.log("✅ ตรวจสอบแล้ว Draft Busy:", isBusyDraft);
|
||||||
// console.log("✅ ตรวจสอบแล้ว Publish Busy:", isBusyPublish);
|
// // console.log("✅ ตรวจสอบแล้ว Publish Busy:", isBusyPublish);
|
||||||
if (isBusyDraft || isBusyPublish) {
|
// if (isBusyDraft || isBusyPublish) {
|
||||||
// console.log("🚫 พบว่ามีงานอยู่ในคิว — error")
|
// // console.log("🚫 พบว่ามีงานอยู่ในคิว — error")
|
||||||
throw new HttpError(
|
// throw new HttpError(
|
||||||
HttpStatusCode.CONFLICT,
|
// HttpStatusCode.CONFLICT,
|
||||||
"ไม่สามารถดำเนินการได้ หากกำลังเผยแพร่หรือสร้างแบบร่างโครงสร้างหน่วยงาน",
|
// "ไม่สามารถดำเนินการได้ หากกำลังเผยแพร่หรือสร้างแบบร่างโครงสร้างหน่วยงาน",
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
|
|
||||||
const today = new Date();
|
const today = new Date();
|
||||||
today.setHours(0, 0, 0, 0); // Set time to the beginning of the day
|
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