This commit is contained in:
seb
2026-09-27 07:08:13 +02:00
parent 3ab9d904e6
commit 559307675c
13 changed files with 845 additions and 8 deletions

View File

@@ -442,6 +442,19 @@ export class ApiClient {
update: (id, body) => this.#json('PATCH', `/api/number/${enc(id)}`, { body }),
};
this.printer = {
/** GET /api/printer → { printers: Printer[] } */
list: () => this.#json('GET', '/api/printer'),
/** POST /api/printer → 201 { printer } */
create: (body) => this.#json('POST', '/api/printer', { body }),
/** PATCH /api/printer/{id} → { printer } */
update: (id, body) => this.#json('PATCH', `/api/printer/${enc(id)}`, { body }),
/** DELETE /api/printer/{id} → 204 */
delete: (id) => this.#empty('DELETE', `/api/printer/${enc(id)}`),
/** PUT /api/printer/order body { printerIds } → { printerIds } */
order: (body) => this.#json('PUT', '/api/printer/order', { body }),
};
this.setting = {
/** GET /api/company/setting?frontendOnly=1 → { settings: [{ key, value, frontend }] } */
list: (query) => this.#json('GET', '/api/company/setting', { query }),

View File

@@ -581,6 +581,14 @@ export const brand = {
upsert(body) {
return http('/api/brand', { method: 'PUT', body });
},
/**
* DELETE /api/brand/:id
* → 204 No Content · 404 Brand not found
*/
delete(id) {
return http(`/api/brand/${encodeURIComponent(id)}`, { method: 'DELETE' });
},
};
/**