create + list + delete shipment

This commit is contained in:
hamid zarghami
2025-09-27 09:59:10 +03:30
parent 834e575d17
commit ee89008a9f
9 changed files with 525 additions and 39 deletions
+19
View File
@@ -0,0 +1,19 @@
import axios from "../../../config/axios";
import type { ShipmentResponse, CreateShipper, Shipper } from "../types/Types";
export const getShipment = async (
page: number = 1
): Promise<ShipmentResponse> => {
const { data } = await axios.get<ShipmentResponse>(`/shipment?page=${page}`);
return data;
};
export const createShipment = async (data: CreateShipper): Promise<Shipper> => {
const response = await axios.post<Shipper>("/admin/shipment", data);
return response.data;
};
export const deleteShipment = async (id: string): Promise<void> => {
const { data } = await axios.delete(`/admin/shipment/${id}`);
return data;
};