u
This commit is contained in:
@@ -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
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user