This commit is contained in:
seb
2026-10-10 18:17:14 +02:00
parent 004e0de869
commit a20668cd61
31 changed files with 572 additions and 76 deletions

View File

@@ -6,44 +6,56 @@ import { http } from './http.js';
*/
export const printer = {
/** GET /api/printer → { printers: Printer[] } */
// #region GET /api/printer — list
list() {
return http('/api/printer');
},
// #endregion
/** GET /api/printer/:id → { printer: Printer } */
// #region GET /api/printer/:id — getById
getById(id) {
return http(`/api/printer/${id}`);
},
// #endregion
/**
* POST /api/printer
* Body: { address, type, model, serial, sort, desc }
* → 201 { printer: Printer }
*/
// #region POST /api/printer — create
create(body) {
return http('/api/printer', { method: 'POST', body });
},
// #endregion
/**
* PATCH /api/printer/:id
* Body: partial printer fields
* → 200 { printer: Printer }
*/
// #region PATCH /api/printer/:id — update
update(id, body) {
return http(`/api/printer/${id}`, { method: 'PATCH', body });
},
// #endregion
/** DELETE /api/printer/:id → 204 */
// #region DELETE /api/printer/:id — delete
delete(id) {
return http(`/api/printer/${id}`, { method: 'DELETE' });
},
// #endregion
/**
* PUT /api/printer/order
* Body: { printerIds: number[] }
* → 200 { printerIds: number[] }
*/
// #region PUT /api/printer/order — order
order({ printerIds }) {
return http('/api/printer/order', { method: 'PUT', body: { printerIds } });
},
// #endregion
};