feat: initialize mohfarawati app foundation
CI / quality (push) Waiting to run

This commit is contained in:
MOH
2026-03-06 13:53:57 +01:00
parent 30330c4f1e
commit f86b7f39f7
50 changed files with 4615 additions and 152 deletions
+28
View File
@@ -0,0 +1,28 @@
import { prisma } from "@/lib/prisma";
export const MAINTENANCE_MODE_KEY = "maintenance_mode";
export async function getMaintenanceMode(): Promise<boolean> {
try {
const config = await prisma.appConfig.findUnique({
where: { key: MAINTENANCE_MODE_KEY },
});
return config?.value === "true";
} catch {
return false;
}
}
export async function setMaintenanceMode(enabled: boolean): Promise<void> {
await prisma.appConfig.upsert({
where: { key: MAINTENANCE_MODE_KEY },
update: {
value: enabled ? "true" : "false",
},
create: {
key: MAINTENANCE_MODE_KEY,
value: enabled ? "true" : "false",
},
});
}