u
This commit is contained in:
@@ -22,6 +22,7 @@ export default function removeChild(provider) {
|
||||
* @param {string} childSku - The child article SKU.
|
||||
* @param {object} [options]
|
||||
* @param {boolean} [options.deleteArticle=false] - Whether to delete the child article entity entirely.
|
||||
* @param {boolean} [options.cascade=true] - Whether to cascade delete child subtrees when deleteArticle is true.
|
||||
* @param {object} [tx] - Optional transaction.
|
||||
* @returns {Promise<{success: boolean, fatherSku: string, childSku: string, deleted: boolean}>}
|
||||
*/
|
||||
@@ -45,7 +46,8 @@ export default function removeChild(provider) {
|
||||
}
|
||||
|
||||
if (options.deleteArticle) {
|
||||
await del(googleAuthId, childSku, runner);
|
||||
const cascade = options.cascade !== undefined ? Boolean(options.cascade) : true;
|
||||
await del(googleAuthId, childSku, { cascade }, runner);
|
||||
return {
|
||||
success: true,
|
||||
fatherSku,
|
||||
|
||||
Reference in New Issue
Block a user