mirror of
https://github.com/Since-3/since3-portal.git
synced 2026-10-12 21:41:16 +00:00
22 lines
No EOL
552 B
TypeScript
22 lines
No EOL
552 B
TypeScript
"use server";
|
|
|
|
import { createAdminClient } from "@/lib/supabase/admin";
|
|
import { verifySession } from "@/lib/supabase/dal";
|
|
|
|
export async function acceptTerms() {
|
|
const session = await verifySession();
|
|
const supabase = createAdminClient();
|
|
|
|
const { error } = await supabase
|
|
.from("profiles")
|
|
.update({ terms_accepted_at: new Date().toISOString() })
|
|
.eq("id", session.userId)
|
|
|
|
if (error) return {
|
|
error: "Zustimmung konnte nicht gespeichert werden."
|
|
};
|
|
|
|
return {
|
|
success: true
|
|
}
|
|
} |