Refactor code

This commit is contained in:
2026-02-03 12:17:47 +01:00
parent ea5eb6fa59
commit 8572e22c5d
185 changed files with 1268 additions and 1458 deletions

View File

@ -1,10 +1,11 @@
'use server';
"use server";
import { prisma } from "@/lib/prisma";
// Returns the most recent Terms of Service markdown.
export async function getLatestTos(): Promise<string | null> {
const tos = await prisma.termsOfService.findFirst({
orderBy: { createdAt: 'desc' },
orderBy: { createdAt: "desc" },
});
return tos?.markdown ?? null;
}

View File

@ -1,11 +1,12 @@
'use server';
"use server";
import { prisma } from "@/lib/prisma";
// Saves a new Terms of Service version.
export async function saveTosAction(markdown: string) {
await prisma.termsOfService.create({
data: {
markdown,
},
});
}
}