This commit is contained in:
seb
2026-09-29 13:45:13 +02:00
parent 4cb050c285
commit 43e1ab98b7
7 changed files with 193 additions and 91 deletions

View File

@@ -327,11 +327,11 @@ export class ApiClient {
delete: (id) => this.#empty('DELETE', `/api/category/${enc(id)}`),
/** PUT /api/category/order */
order: (body) => this.#json('PUT', '/api/category/order', { body }),
/** POST /api/category/{id}/image — raw AVIF body */
addImage: (id, avifBytes) =>
/** POST /api/category/{id}/image — raw image body */
addImage: (id, imageBytes) =>
this.#json('POST', `/api/category/${enc(id)}/image`, {
body: avifBytes,
contentType: 'image/avif',
body: imageBytes,
contentType: imageBytes?.type || 'image/webp',
raw: true,
}),
/** DELETE /api/category/{id}/image */
@@ -380,11 +380,11 @@ export class ApiClient {
delete: (sku) => this.#empty('DELETE', `/api/article/${enc(sku)}`),
/** PUT /api/article/{sku}/prices */
setPrices: (sku, body) => this.#json('PUT', `/api/article/${enc(sku)}/prices`, { body }),
/** POST /api/article/{sku}/image — raw AVIF body */
addImage: (sku, avifBytes) =>
/** POST /api/article/{sku}/image — raw image body */
addImage: (sku, imageBytes) =>
this.#json('POST', `/api/article/${enc(sku)}/image`, {
body: avifBytes,
contentType: 'image/avif',
body: imageBytes,
contentType: imageBytes?.type || 'image/webp',
raw: true,
}),
/** DELETE /api/article/{sku}/image/{fullHash} */