Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
content: ''
}
Cosmic.editObject(config, params, (error, response)=>{
if(response.object){
console.log(chalk.green("\u2713" + " Success"))
}
MainMenu()
})
})
} else if(answers.morecontext === 'delete'){
var params = {
write_key: config.bucket.write_key,
slug: response.object.slug
}
Cosmic.deleteObject(config, params, (error, response)=>{
if(error){
console.log(error)
}
if(response.object){
console.log(chalk.green("\u2713" + " Success"))
}
MainMenu();
});
} else {
MainMenu();
}
})
})
removeItem: function(payload){
let _id = payload._id;
let _this = this;
let delete_object = {
_id: _id
};
Cosmic.deleteObject(config, delete_object, function(err, object){
let items = _this.items;
_.remove(items,(item) => {
return _id == item._id;
});
_this.items = items;
_this.emitChange();
});
},
async.eachSeries(notes, (note, callback) => {
const params = {
write_key: config.bucket.write_key,
slug: note.slug,
};
if (!!note.metafields && !!note.metafields[1]) {
deleteMedia(note.metafields[1].id);
}
if (!!note.metafields && !!note.metafields[2]) {
deleteMedia(note.metafields[2].id);
}
Cosmic.deleteObject(config, params, (err, res)=> {
callback();
})
});
const response = yield call(cosmic, "DELETE", params);