refactor(blocking notification): changed to look at the latest blocking order and only pull 1 at a t
This commit is contained in:
@@ -39,9 +39,16 @@ export default async function qualityBlockingMonitor(notifyData: any) {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// console.log(blockingOrders);
|
||||||
|
|
||||||
|
// let blockingQuery = blockQuery.replaceAll(
|
||||||
|
// "[sentBlockingOrders]",
|
||||||
|
// blockingOrders
|
||||||
|
// );
|
||||||
|
|
||||||
let blockingQuery = blockQuery.replaceAll(
|
let blockingQuery = blockQuery.replaceAll(
|
||||||
"[sentBlockingOrders]",
|
"[lastBlocking]",
|
||||||
blockingOrders
|
notiData[0]?.notifiySettings.prodID
|
||||||
);
|
);
|
||||||
|
|
||||||
const { data: b, error: blockingError } = await tryCatch(
|
const { data: b, error: blockingError } = await tryCatch(
|
||||||
@@ -115,6 +122,12 @@ export default async function qualityBlockingMonitor(notifyData: any) {
|
|||||||
.where(eq(notifications.name, notifyData.name))
|
.where(eq(notifications.name, notifyData.name))
|
||||||
);
|
);
|
||||||
if (error) {
|
if (error) {
|
||||||
|
createLog(
|
||||||
|
"error",
|
||||||
|
"blocking",
|
||||||
|
"notify",
|
||||||
|
"Error updating the blocking orders"
|
||||||
|
);
|
||||||
return {
|
return {
|
||||||
success: false,
|
success: false,
|
||||||
message: "Error updating the blocking orders",
|
message: "Error updating the blocking orders",
|
||||||
|
|||||||
Reference in New Issue
Block a user