feat(notificaitons): fixed and corrections to get them working properly
This commit is contained in:
@@ -31,7 +31,10 @@ export const note: any = [
|
||||
timeType: "min",
|
||||
emails: "",
|
||||
active: false,
|
||||
notifiySettings: { prodID: 1, sentBlockingOrders: [1] },
|
||||
notifiySettings: {
|
||||
prodID: 1,
|
||||
sentBlockingOrders: [{ timeStamp: "0", blockingOrder: 1 }],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "productionCheck",
|
||||
@@ -72,8 +75,8 @@ export const note: any = [
|
||||
notifiySettings: {
|
||||
prodID: 1,
|
||||
start: 36,
|
||||
end: 720,
|
||||
releases: [1, 2, 3],
|
||||
end: 36,
|
||||
releases: [{ timeStamp: "0", releaseNumber: 1 }],
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -86,7 +89,7 @@ export const note: any = [
|
||||
notifiySettings: {
|
||||
prodID: 1,
|
||||
start: 36,
|
||||
end: 720,
|
||||
end: 36,
|
||||
releases: [1, 2, 3],
|
||||
},
|
||||
},
|
||||
@@ -98,7 +101,14 @@ export const notificationCreate = async () => {
|
||||
const notify = await db
|
||||
.insert(notifications)
|
||||
.values(note[i])
|
||||
.onConflictDoNothing();
|
||||
.onConflictDoUpdate({
|
||||
target: notifications.name,
|
||||
set: {
|
||||
name: note[i].name,
|
||||
description: note[i].description,
|
||||
//notifiySettings: note[i].notifiySettings,
|
||||
},
|
||||
});
|
||||
} catch (error) {
|
||||
createLog(
|
||||
"error",
|
||||
@@ -110,4 +120,10 @@ export const notificationCreate = async () => {
|
||||
);
|
||||
}
|
||||
}
|
||||
createLog(
|
||||
"info",
|
||||
"lst",
|
||||
"nofity",
|
||||
"notifications were just added/updated due to server startup"
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user