feat: active & deactivate the price for product
This commit is contained in:
@@ -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
|
||||
// ============================================
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user