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,37 +6,47 @@ import { http } from './http.js';
*/
export const labeltemplate = {
/** GET /api/labeltemplate → { labeltemplates: LabelTemplate[] } */
// #region GET /api/labeltemplate — list
list() {
return http('/api/labeltemplate');
},
// #endregion
/** GET /api/labeltemplate/:id → { labeltemplate: LabelTemplate } */
// #region GET /api/labeltemplate/:id — get
get(id) {
return http(`/api/labeltemplate/${encodeURIComponent(id)}`);
},
// #endregion
/**
* POST /api/labeltemplate
* Body: { name, width, height, dpi, type, content }
* → 201 { labeltemplate: LabelTemplate }
*/
// #region POST /api/labeltemplate — create
create(body) {
return http('/api/labeltemplate', { method: 'POST', body });
},
// #endregion
/**
* PATCH /api/labeltemplate/:id
* Body: partial { name?, width?, height?, dpi?, type?, content? }
* → 200 { labeltemplate: LabelTemplate }
*/
// #region PATCH /api/labeltemplate/:id — update
update(id, body) {
return http(`/api/labeltemplate/${encodeURIComponent(id)}`, { method: 'PATCH', body });
},
// #endregion
/** DELETE /api/labeltemplate/:id → 204 */
// #region DELETE /api/labeltemplate/:id — delete
delete(id) {
return http(`/api/labeltemplate/${encodeURIComponent(id)}`, { method: 'DELETE' });
},
// #endregion
// thumb is returned inline as a base64 string in list/get responses
};