Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter out non-deleted products from product-clean-up results #38

Open
pulkitsinghal opened this issue Apr 16, 2016 · 0 comments
Open
Labels

Comments

@pulkitsinghal
Copy link
Contributor

  1. When product-clean-up command runs, it produces a CSV file with all the deleted and non-deleted products as part of the clean-up. It should only contain the list of those successfully deleted. Otherwise the CSV is not useful for rollback/reimports.
  2. The file which contains the reasons from Vend as to why some product deletions were "refused" ... does not always print out.

This code-block is not promise-capable:

.then(function deletionResults(deleteIt){
    if(deleteIt.status != "success"){
        unsuccessful++;
        fs.appendFileSync(defaultOutputDirectory+"nonDeletable.txt",unsuccessful+". Product : "+ singleProductToDelete.name +" Reason : "+ deleteIt.details+"\n",'utf8');
    }
    else {
        successful++;
    }
})

It uses code like fs.appendFileSync which is problematic and simply adding return Promise.resolve(); at the end of that block might not fix anything. Needs testing and rewrite.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant