This commit is contained in:
seb
2026-09-29 18:50:27 +02:00
parent 1b9c39e975
commit d8f4727f32
6 changed files with 772 additions and 96 deletions

View File

@@ -479,6 +479,46 @@ export const article = {
{ method: 'DELETE' }
);
},
/**
* POST /api/article/:sku/father
* Body: { isFather: boolean, attributeNameId?: number }
*/
toggleFather(sku, body) {
return http(`/api/article/${encodeURIComponent(sku)}/father`, {
method: 'POST',
body,
});
},
/**
* GET /api/article/:sku/children → { children: [...] }
*/
getChildren(sku) {
return http(`/api/article/${encodeURIComponent(sku)}/children`);
},
/**
* POST /api/article/:sku/children
* Body: { attributeValueId?: number, value?: string, name?: string }
*/
addChild(sku, body) {
return http(`/api/article/${encodeURIComponent(sku)}/children`, {
method: 'POST',
body,
});
},
/**
* DELETE /api/article/:sku/children/:childSku
*/
removeChild(sku, childSku, options = {}) {
const qs = options?.deleteArticle ? '?deleteArticle=true' : '';
return http(
`/api/article/${encodeURIComponent(sku)}/children/${encodeURIComponent(childSku)}${qs}`,
{ method: 'DELETE' }
);
},
};
/**