mirror of
http://88.130.71.182:3000/BlitTech/badoHair_fe.git
synced 2026-06-13 10:41:11 +00:00
Fix product stock, booking actions, settings, reservation UX, nav and category filter
This commit is contained in:
@@ -25,12 +25,14 @@ export async function register(
|
||||
email: string,
|
||||
password: string,
|
||||
name: string
|
||||
): Promise<UserProfile> {
|
||||
const tokens = await api.post<AuthResponse>("/auth/register", { email, password, name });
|
||||
if ("access_token" in (tokens as object)) {
|
||||
setTokens((tokens as AuthResponse).access_token, (tokens as AuthResponse).refresh_token);
|
||||
): Promise<UserProfile | null> {
|
||||
const res = await api.post<AuthResponse | { message: string }>("/auth/register", { email, password, name });
|
||||
if ("access_token" in res) {
|
||||
setTokens(res.access_token, (res as AuthResponse).refresh_token);
|
||||
return api.get<UserProfile>("/auth/me");
|
||||
}
|
||||
return api.get<UserProfile>("/auth/me");
|
||||
// Email confirmation required — no session yet
|
||||
return null;
|
||||
}
|
||||
|
||||
export async function getMe(): Promise<UserProfile> {
|
||||
|
||||
Reference in New Issue
Block a user