shrt b171956105
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 0s
added google auth provider
2025-03-16 14:34:32 +01:00

21 lines
690 B
TypeScript

"use server";
import { userSchema } from "@/lib/validation/zod/user";
import { api } from "@/trpc/server";
import { revalidatePath } from "next/cache";
import { z } from "zod";
export async function updateUserProfile(profile: z.infer<typeof userSchema>) {
const [result] = await api.users.updateProfile({ profile });
if (!result?.id) return { success: false };
revalidatePath("/me");
return { success: true };
}
export async function setUserPermissions(userId: string, permission: number) {
const result = await api.users.setPermission({ userId, permission });
if (!result[0]?.id) return { success: false };
revalidatePath("/admin/benutzer");
return { success: true };
}