mirror of
https://github.com/Since-3/since3-portal.git
synced 2026-10-12 19:51:17 +00:00
see comments
This commit is contained in:
parent
59f209d754
commit
eadbcd61e4
1 changed files with 4 additions and 3 deletions
|
|
@ -3,6 +3,7 @@
|
|||
import * as z from "zod";
|
||||
import { revalidatePath } from "next/cache";
|
||||
import { createAdminClient } from "@/lib/supabase/admin";
|
||||
import { createClient } from "@/lib/supabase/server";
|
||||
import { verifySession } from "@/lib/supabase/dal";
|
||||
|
||||
async function resolveClientId(profileId: string) {
|
||||
|
|
@ -55,7 +56,7 @@ export async function createCredential(
|
|||
return { error: "Client hat noch keine Stammdaten hinterlegt." };
|
||||
}
|
||||
|
||||
const supabase = createAdminClient();
|
||||
const supabase = await createClient();
|
||||
const { error } = await supabase.rpc("create_credential", {
|
||||
p_client_id: clientId,
|
||||
p_service: validatedFields.data.service,
|
||||
|
|
@ -106,7 +107,7 @@ export async function updateCredential(
|
|||
return { error: firstError ?? "Bitte alle Felder ausfüllen." };
|
||||
}
|
||||
|
||||
const supabase = createAdminClient();
|
||||
const supabase = await createClient();
|
||||
const { error } = await supabase.rpc("update_credential", {
|
||||
p_id: validatedFields.data.credentialId,
|
||||
p_service: validatedFields.data.service,
|
||||
|
|
@ -125,7 +126,7 @@ export async function updateCredential(
|
|||
export async function revealCredential(credentialId: string): Promise<{ password: string } | { error: string }> {
|
||||
await verifySession();
|
||||
|
||||
const supabase = createAdminClient();
|
||||
const supabase = await createClient();
|
||||
const { data, error } = await supabase.rpc("reveal_credential", { p_id: credentialId });
|
||||
|
||||
if (error || typeof data !== "string") {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue