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(
|
||||
"[sentBlockingOrders]",
|
||||
blockingOrders
|
||||
"[lastBlocking]",
|
||||
notiData[0]?.notifiySettings.prodID
|
||||
);
|
||||
|
||||
const { data: b, error: blockingError } = await tryCatch(
|
||||
@@ -115,6 +122,12 @@ export default async function qualityBlockingMonitor(notifyData: any) {
|
||||
.where(eq(notifications.name, notifyData.name))
|
||||
);
|
||||
if (error) {
|
||||
createLog(
|
||||
"error",
|
||||
"blocking",
|
||||
"notify",
|
||||
"Error updating the blocking orders"
|
||||
);
|
||||
return {
|
||||
success: false,
|
||||
message: "Error updating the blocking orders",
|
||||
|
||||
Reference in New Issue
Block a user