u
This commit is contained in:
@@ -94,6 +94,24 @@ export class ApiClient {
|
||||
},
|
||||
};
|
||||
|
||||
this.warehouse = {
|
||||
/** GET /api/warehouse → { warehouses: Warehouse[] } */
|
||||
list: () => this.#json('GET', '/api/warehouse'),
|
||||
/** GET /api/warehouse/{id} → { warehouse: Warehouse } */
|
||||
getById: (id) => this.#json('GET', `/api/warehouse/${enc(id)}`),
|
||||
/** POST /api/warehouse → 201 { warehouse: Warehouse } */
|
||||
create: (body) => this.#json('POST', '/api/warehouse', { body }),
|
||||
/** PATCH /api/warehouse/{id} → 200 { warehouse: Warehouse } */
|
||||
update: (id, body) => this.#json('PATCH', `/api/warehouse/${enc(id)}`, { body }),
|
||||
/** DELETE /api/warehouse/{id} → 204 */
|
||||
delete: (id) => this.#empty('DELETE', `/api/warehouse/${enc(id)}`),
|
||||
};
|
||||
|
||||
this.stock = {
|
||||
/** POST /api/stock/adjust → 201 { manifest, lines, ledger } */
|
||||
adjust: (body) => this.#json('POST', '/api/stock/adjust', { body }),
|
||||
};
|
||||
|
||||
this.delivery = {
|
||||
/** GET /api/delivery → { deliveries: DeliverySummary[] } */
|
||||
list: () => this.#json('GET', '/api/delivery'),
|
||||
|
||||
Reference in New Issue
Block a user