chore: add new features
This commit is contained in:
@@ -6,6 +6,13 @@
|
||||
// ✅ sessionStorage (pas localStorage)
|
||||
|
||||
const API_URL = "https://uber-stup.club/api/v1";
|
||||
const BACKEND_URL = "https://uber-stup.club";
|
||||
|
||||
export function getMediaUrl(url: string): string {
|
||||
if (!url) return "";
|
||||
if (url.startsWith("http")) return url;
|
||||
return `${BACKEND_URL}${url}`;
|
||||
}
|
||||
import type {
|
||||
ConfirmReceptionResponse,
|
||||
CheckoutCartResponse,
|
||||
@@ -291,14 +298,21 @@ export const changePassword = async (
|
||||
if (!response.ok) {
|
||||
return {
|
||||
success: false,
|
||||
message: data.error || data.message || "Erreur lors du changement de mot de passe",
|
||||
message:
|
||||
data.error ||
|
||||
data.message ||
|
||||
"Erreur lors du changement de mot de passe",
|
||||
};
|
||||
}
|
||||
return { success: true, message: data.message || "Mot de passe mis à jour" };
|
||||
return {
|
||||
success: true,
|
||||
message: data.message || "Mot de passe mis à jour",
|
||||
};
|
||||
} catch (error) {
|
||||
return {
|
||||
success: false,
|
||||
message: error instanceof Error ? error.message : "Erreur de connexion",
|
||||
message:
|
||||
error instanceof Error ? error.message : "Erreur de connexion",
|
||||
};
|
||||
}
|
||||
};
|
||||
@@ -763,6 +777,7 @@ export interface Product {
|
||||
name: string;
|
||||
description?: string;
|
||||
category: string;
|
||||
unit?: string;
|
||||
stock: number;
|
||||
prices?: Array<{ quantity: number; price: number }>;
|
||||
media?: MediaItem[]; // ✅ CHANGÉ: string[] → MediaItem[]
|
||||
|
||||
@@ -365,6 +365,7 @@ export interface Product {
|
||||
description?: string;
|
||||
category: string;
|
||||
stock: number;
|
||||
unit?: string;
|
||||
prices?: ProductPrice[];
|
||||
media?: Array<{
|
||||
// ✅ CHANGÉ
|
||||
|
||||
Reference in New Issue
Block a user