u
This commit is contained in:
@@ -5,6 +5,26 @@ import { http } from './http.js';
|
||||
* Manifest number format: <orderNumber><shipmentPrefix><index>, e.g. AU-1001-L-1.
|
||||
*/
|
||||
export const shipment = {
|
||||
// #region GET /api/shipment — list
|
||||
list(params = {}) {
|
||||
const q = new URLSearchParams();
|
||||
if (params.offset != null) q.set('offset', String(params.offset));
|
||||
if (params.limit != null) q.set('limit', String(params.limit));
|
||||
if (params.search) q.set('search', String(params.search));
|
||||
if (params.state) q.set('state', String(params.state));
|
||||
if (params.orderId != null) q.set('orderId', String(params.orderId));
|
||||
if (params.seekMonths != null) q.set('seekMonths', String(params.seekMonths));
|
||||
const qs = q.toString();
|
||||
return http(`/api/shipment${qs ? `?${qs}` : ''}`);
|
||||
},
|
||||
// #endregion
|
||||
|
||||
// #region PATCH /api/shipment/:id — update
|
||||
update(id, body) {
|
||||
return http(`/api/shipment/${id}`, { method: 'PATCH', body });
|
||||
},
|
||||
// #endregion
|
||||
|
||||
// #region GET /api/order/:id/shipment — listByOrder
|
||||
listByOrder(orderId) {
|
||||
return http(`/api/order/${orderId}/shipment`);
|
||||
|
||||
Reference in New Issue
Block a user