feat: add shipment management modal for admin
- Add ShipmentManagementModal component to manage shop shipment methods - Add button to Shop settings page to open shipment management modal - Update useShipmentData hooks to invalidate queries after add/remove operations - Modal shows active and available shipment methods for admin to manage
This commit is contained in:
@@ -4,6 +4,7 @@ import type {
|
||||
CreateShipper,
|
||||
Shipper,
|
||||
ShipmentByIdResponse,
|
||||
GetAdminShopResponse,
|
||||
} from "../types/Types";
|
||||
|
||||
export const getShipment = async (
|
||||
@@ -37,3 +38,22 @@ export const updateShipment = async (
|
||||
const { data } = await axios.patch<Shipper>(`/admin/shipment/${id}`, params);
|
||||
return data;
|
||||
};
|
||||
|
||||
export const removeShipmentFromAdmin = async (id: string): Promise<void> => {
|
||||
const { data } = await axios.post(`/admin/shipment/shipment/deactivate`, {
|
||||
shipmentId: id,
|
||||
});
|
||||
return data;
|
||||
};
|
||||
|
||||
export const addShipmentToAdmin = async (id: string): Promise<void> => {
|
||||
const { data } = await axios.post(`/admin/shipment/shipment/activate`, {
|
||||
shipmentId: id,
|
||||
});
|
||||
return data;
|
||||
};
|
||||
|
||||
export const getAdminShop = async (): Promise<GetAdminShopResponse> => {
|
||||
const { data } = await axios.get<GetAdminShopResponse>(`/admin/shop`);
|
||||
return data;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user