From c9eb59e2ad9847418ac55cb8a4a91c013f6c97bb Mon Sep 17 00:00:00 2001 From: Blake Matthes Date: Fri, 10 Apr 2026 13:57:52 -0500 Subject: [PATCH] refactor(reprint): new query added to deactivate the old notifcation so no chance of duplicates --- backend/notification/notification.reprintLabels.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/notification/notification.reprintLabels.ts b/backend/notification/notification.reprintLabels.ts index 2b5508b..b3f10a8 100644 --- a/backend/notification/notification.reprintLabels.ts +++ b/backend/notification/notification.reprintLabels.ts @@ -9,9 +9,12 @@ import { import { returnFunc } from "../utils/returnHelper.utils.js"; import { sendEmail } from "../utils/sendEmail.utils.js"; import { tryCatch } from "../utils/trycatch.utils.js"; +import { v1QueryRun } from "../utils/pgConnectToLst.utils.js"; const reprint = async (data: any, emails: string) => { - // TODO: do the actual logic for the notification. + // TODO: remove this disable once all 17 plants are on this new lst + v1QueryRun(`update public.notifications set active = false where name = '${data.name}'`) + const { data: l, error: le } = (await tryCatch( db.select().from(notifications).where(eq(notifications.id, data.id)), )) as any;