"use server";
import { prisma, Prisma } from "@repo/db";

export const addMessage = async (notam: Prisma.ConfigCreateInput) => {
	try {
		await prisma.config.create({
			data: notam,
		});
	} catch (e) {
		throw new Error(`Failed to add message: ${e instanceof Error ? e.message : "Unknown error"}`);
	}
};

export const disableMessage = async () => {
	try {
		await prisma.config.create({
			data: {},
		});
	} catch (e) {
		throw new Error(`Failed to add message: ${e instanceof Error ? e.message : "Unknown error"}`);
	}
};
