refactor: update

This commit is contained in:
Mauricio Siu
2025-02-15 23:24:45 -06:00
parent ed62b4e1a3
commit 4a1a14aeb4
22 changed files with 119 additions and 120 deletions

View File

@@ -270,7 +270,7 @@ export const apiCreateGotify = notificationsSchema
export const apiUpdateGotify = apiCreateGotify.partial().extend({
notificationId: z.string().min(1),
gotifyId: z.string().min(1),
userId: z.string().optional(),
organizationId: z.string().optional(),
});
export const apiTestGotifyConnection = apiCreateGotify

View File

@@ -18,7 +18,7 @@ interface ServerThresholdPayload {
}
export const sendServerThresholdNotifications = async (
userId: string,
organizationId: string,
payload: ServerThresholdPayload,
) => {
const date = new Date(payload.Timestamp);
@@ -27,7 +27,7 @@ export const sendServerThresholdNotifications = async (
const notificationList = await db.query.notifications.findMany({
where: and(
eq(notifications.serverThreshold, true),
eq(notifications.userId, userId),
eq(notifications.organizationId, organizationId),
),
with: {
email: true,