Fix product stock, booking actions, settings, reservation UX, nav and category filter

This commit is contained in:
belviskhoremk
2026-05-20 23:56:43 +00:00
parent a89793a059
commit affff1c502
12 changed files with 137 additions and 102 deletions

View File

@@ -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> {

View File

@@ -40,6 +40,7 @@ function toProduct(p: ApiProduct): Product {
isBestseller: p.is_bestseller,
rating: p.rating,
reviewCount: p.review_count,
stockQuantity: p.stock_quantity,
};
}