refactor(notification): blocking added
This commit is contained in:
@@ -10,11 +10,16 @@ import { delay } from "../utils/delay.utils.js";
|
||||
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";
|
||||
import { v2QueryRun } from "../utils/pgConnectToLst.utils.js";
|
||||
|
||||
let shutoffv1 = false
|
||||
const func = async (data: any, emails: string) => {
|
||||
// TODO: remove this disable once all 17 plants are on this new lst
|
||||
v1QueryRun(`update public.notifications set active = false where name = '${data.name}'`)
|
||||
if (!shutoffv1){
|
||||
v2QueryRun(`update public.notifications set active = false where name = '${data.name}'`)
|
||||
shutoffv1 = true
|
||||
}
|
||||
|
||||
|
||||
const { data: l, error: le } = (await tryCatch(
|
||||
db.select().from(notifications).where(eq(notifications.id, data.id)),
|
||||
|
||||
Reference in New Issue
Block a user