feat: add user centric features

This commit is contained in:
gosangam
2026-05-30 23:44:08 +05:30
parent 7bd2952caa
commit dcdd2383c6
63 changed files with 16783 additions and 1735 deletions
+8 -1
View File
@@ -17,9 +17,11 @@ const BFF_BASE =
export type User = {
id: string;
email: string;
handle: string;
name: string;
avatar_url: string | null;
role: string;
plan: "free" | "premium";
email_verified_at: string | null;
created_at: string;
updated_at: string;
@@ -110,12 +112,17 @@ export const auth = {
resendVerification: () =>
authFetch<{ ok: boolean }>("/auth/resend-verification", { method: "POST" }),
updateProfile: (name?: string, avatarURL?: string | null) =>
updateProfile: (
name?: string,
avatarURL?: string | null,
handle?: string,
) =>
authFetch<User>("/users/me", {
method: "PATCH",
body: JSON.stringify({
name: name ?? undefined,
avatar_url: avatarURL === undefined ? undefined : avatarURL,
handle: handle ?? undefined,
}),
}),