u
This commit is contained in:
@@ -285,8 +285,9 @@ export const article = {
|
||||
* DELETE /api/article/:sku → 204
|
||||
* Errors: 400 Article has children, 401, 403, 404 Article not found
|
||||
*/
|
||||
delete(sku) {
|
||||
return http(`/api/article/${encodeURIComponent(sku)}`, {
|
||||
delete(sku, { cascade = false } = {}) {
|
||||
const qs = cascade ? '?cascade=true' : '';
|
||||
return http(`/api/article/${encodeURIComponent(sku)}${qs}`, {
|
||||
method: 'DELETE',
|
||||
});
|
||||
},
|
||||
@@ -744,9 +745,13 @@ export const category = {
|
||||
});
|
||||
},
|
||||
|
||||
/** DELETE /api/category/:id → 204 */
|
||||
delete(categoryId) {
|
||||
return http(`/api/category/${categoryId}`, { method: 'DELETE' });
|
||||
/**
|
||||
* DELETE /api/category/:id → 204
|
||||
* Query: ?recursive=true (cascades deletion of subcategories and articles)
|
||||
*/
|
||||
delete(categoryId, { recursive = false } = {}) {
|
||||
const qs = recursive ? '?recursive=true' : '';
|
||||
return http(`/api/category/${categoryId}${qs}`, { method: 'DELETE' });
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user