feat: active & deactivate the price for product

This commit is contained in:
2026-05-14 16:20:59 +02:00
parent 0fe8a06bfa
commit e0c354d76c
4 changed files with 66 additions and 15 deletions
+14
View File
@@ -747,6 +747,20 @@ export const deleteProductMediaAdmin = async (
return { success: true, message: data.message };
};
export const activateProductPrice = async (priceId: number) => {
const { data } = await apiClient.post(
`${V2}/admin/protected/active/product/price/${priceId}`,
);
return { success: true, message: data.message };
};
export const deactivateProductPrice = async (priceId: number) => {
const { data } = await apiClient.post(
`${V2}/admin/protected/desactive/product/price/${priceId}`,
);
return { success: true, message: data.message };
};
// ============================================
// ADDRESSES
// ============================================
+1 -1
View File
@@ -102,7 +102,7 @@ export interface Product {
category: string;
stock: number;
unit: string;
prices?: Array<{ quantity: number; price: number }>;
prices?: Array<{ id?: number; quantity: number; price: number; active_price?: boolean }>;
media?: Array<{ url: string; type: string; id?: number; created_at?: string }>;
created_at?: string;
updated_at?: string;