u
This commit is contained in:
@@ -497,6 +497,22 @@ export class ApiClient {
|
||||
'DELETE',
|
||||
`/api/article/${enc(sku)}/children/${enc(childSku)}${deleteArticle ? '?deleteArticle=true' : ''}`
|
||||
),
|
||||
/** GET /api/article/{sku}/articlelist */
|
||||
getArticlelist: (sku) =>
|
||||
this.#json('GET', `/api/article/${enc(sku)}/articlelist`),
|
||||
/** PUT /api/article/{sku}/articlelist */
|
||||
setArticlelist: (sku, items) =>
|
||||
this.#json('PUT', `/api/article/${enc(sku)}/articlelist`, {
|
||||
body: Array.isArray(items) ? { items } : items,
|
||||
}),
|
||||
/** GET /api/article/{sku}/optionslist */
|
||||
getOptionslist: (sku) =>
|
||||
this.#json('GET', `/api/article/${enc(sku)}/optionslist`),
|
||||
/** PUT /api/article/{sku}/optionslist */
|
||||
setOptionslist: (sku, options) =>
|
||||
this.#json('PUT', `/api/article/${enc(sku)}/optionslist`, {
|
||||
body: Array.isArray(options) ? { options } : options,
|
||||
}),
|
||||
};
|
||||
|
||||
this.posterminal = {
|
||||
|
||||
@@ -519,6 +519,42 @@ export const article = {
|
||||
{ method: 'DELETE' }
|
||||
);
|
||||
},
|
||||
|
||||
/**
|
||||
* GET /api/article/:sku/articlelist → { items: [...] }
|
||||
*/
|
||||
getArticlelist(sku) {
|
||||
return http(`/api/article/${encodeURIComponent(sku)}/articlelist`);
|
||||
},
|
||||
|
||||
/**
|
||||
* PUT /api/article/:sku/articlelist
|
||||
* Body: { items: [{ articleId, sku, count, sort }] }
|
||||
*/
|
||||
setArticlelist(sku, items) {
|
||||
return http(`/api/article/${encodeURIComponent(sku)}/articlelist`, {
|
||||
method: 'PUT',
|
||||
body: Array.isArray(items) ? { items } : items,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* GET /api/article/:sku/optionslist → { options: [...] }
|
||||
*/
|
||||
getOptionslist(sku) {
|
||||
return http(`/api/article/${encodeURIComponent(sku)}/optionslist`);
|
||||
},
|
||||
|
||||
/**
|
||||
* PUT /api/article/:sku/optionslist
|
||||
* Body: { options: [{ articleId, sku, count, sort, mandated }] }
|
||||
*/
|
||||
setOptionslist(sku, options) {
|
||||
return http(`/api/article/${encodeURIComponent(sku)}/optionslist`, {
|
||||
method: 'PUT',
|
||||
body: Array.isArray(options) ? { options } : options,
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -611,7 +647,7 @@ export const category = {
|
||||
|
||||
/**
|
||||
* GET /api/category/:id/articles → { articles: [...] }
|
||||
* Article rows: sku, name, net, taxRate, fullHash, thumbW, thumbH, thumbHash, …
|
||||
* Article rows: sku, name, net, taxRate, fullHash, thumbW, thumbH, thumbHash, childCount, …
|
||||
*/
|
||||
getArticles(categoryId) {
|
||||
return http(`/api/category/${categoryId}/articles`);
|
||||
|
||||
Reference in New Issue
Block a user