diff --git a/src/lib/server/notifications/handler.ts b/src/lib/server/notifications/handler.ts index 07c83377effd06c19295f606c19f0f1e6126e163..908bae19b90e4b434b7b3b1b470001b36e2897ea 100644 --- a/src/lib/server/notifications/handler.ts +++ b/src/lib/server/notifications/handler.ts @@ -1,6 +1,6 @@ import { db } from "$lib/server/database"; import { ChannelType } from "./channelTypes"; -import type { HandlerReturnType, NotificationChannel, NotificationData, NotificationType, PossibleNotificationType } from "../../notifications/types"; +import type { HandlerReturnError, HandlerReturnIgnored, HandlerReturnType, NotificationChannel, NotificationData, NotificationType, PossibleNotificationType } from "../../notifications/types"; export async function sendNotification<T extends PossibleNotificationType>(user: { id: number, notificationChannels: NotificationChannel[] | undefined } | number, type: NotificationType<T>, data: NotificationData<T>): Promise<HandlerReturnType[]>{ let notificationChannels: NotificationChannel[]; @@ -23,7 +23,7 @@ export async function sendNotification<T extends PossibleNotificationType>(user: status: "error", channel, error: err - } as HandlerReturnType; + } as HandlerReturnError; }); } case ChannelType.WEBHOOK.key: { @@ -33,7 +33,7 @@ export async function sendNotification<T extends PossibleNotificationType>(user: status: "error", channel, error: err - } as HandlerReturnType; + } as HandlerReturnError; }); } default: { @@ -41,7 +41,7 @@ export async function sendNotification<T extends PossibleNotificationType>(user: return { status: "ignored", channel - } as HandlerReturnType; + } as HandlerReturnIgnored; } }; }));