23 lines
527 B
TypeScript
23 lines
527 B
TypeScript
"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"}`);
|
|
}
|
|
};
|