Skip to content
Snippets Groups Projects
Commit f57464df authored by Aaron Dötsch's avatar Aaron Dötsch
Browse files

Move channelTypes.js from $lib to $lib/server

parent 6698107d
No related branches found
No related tags found
No related merge requests found
import { handleWebhook } from "../server/notifications/webhookHandler"; import { handleWebhook } from "./webhookHandler";
import { handleEmail } from "../server/notifications/emailHandler"; import { handleEmail } from "./emailHandler";
/** /**
* @type {{ * @type {{
* WEBHOOK: import("./types").ChannelType<?>, * WEBHOOK: import("../../notifications/types").ChannelType<?>,
* EMAIL: import("./types").ChannelType<?> * EMAIL: import("../../notifications/types").ChannelType<?>
* }} * }}
*/ */
export const ChannelType = { export const ChannelType = {
......
import { db } from "$lib/server/database"; import { db } from "$lib/server/database";
import { ChannelType } from "../../notifications/channelTypes"; import { ChannelType } from "./channelTypes";
import type { HandlerReturnType, NotificationChannel, NotificationData, NotificationType, PossibleNotificationType } from "../../notifications/types"; import type { 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[]>{ export async function sendNotification<T extends PossibleNotificationType>(user: { id: number, notificationChannels: NotificationChannel[] | undefined } | number, type: NotificationType<T>, data: NotificationData<T>): Promise<HandlerReturnType[]>{
......
import { addUserCard, getUser, updateCard } from "../../api/users"; import { addUserCard, getUser, updateCard } from "../../api/users";
import { fail } from "@sveltejs/kit"; import { fail } from "@sveltejs/kit";
import { createTransaction } from "../../api/transactions"; import { createTransaction } from "../../api/transactions";
import { ChannelType } from "$lib/notifications/channelTypes"; import { ChannelType } from "$lib/server/notifications/channelTypes";
import { createNotificationChannel, updateNotificationChannel } from "../../api/notificationChannels"; import { createNotificationChannel, updateNotificationChannel } from "../../api/notificationChannels";
export const load = async ({ params }) => { export const load = async ({ params }) => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment