Alter Maintenance-Screen hinzugefügt
This commit is contained in:
22
apps/hub/app/(app)/admin/config/action.tsx
Normal file
22
apps/hub/app/(app)/admin/config/action.tsx
Normal file
@@ -0,0 +1,22 @@
|
||||
"use server";
|
||||
import { prisma, Prisma } from "@repo/db";
|
||||
|
||||
export const addMessage = async (notam: Prisma.NotamCreateInput) => {
|
||||
try {
|
||||
await prisma.notam.create({
|
||||
data: notam,
|
||||
});
|
||||
} catch (error) {
|
||||
throw new Error("Failed to add message");
|
||||
}
|
||||
};
|
||||
|
||||
export const disableMessage = async () => {
|
||||
try {
|
||||
await prisma.notam.create({
|
||||
data: {},
|
||||
});
|
||||
} catch (error) {
|
||||
throw new Error("Failed to disable message");
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user