Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
prompt.get(schema, function (err, result) {
if(err) {
return;
}
logger.info('about to save ' + resource.lowerResource.magenta);
cliff.putObject(result);
result.id = record.id;
confirm(function(err, promptResult){
resource.update(record.id, result, function(err, r){
if(err) {
return logger.error(JSON.stringify(err))
}
logger.info('saved ' + resource.lowerResource.magenta + ' ' + r.id.grey)
})
});
});
});
resource.get(id, function(err, record){
if(err) {
logger.error(JSON.stringify(err))
return;
}
var schema = utile.clone(resource.schema);
logger.info('about to destroy ' + resource.lowerResource.magenta + ' ' + record.id);
cliff.putObject(record);
confirm(function(err, promptResult){
resource.destroy(record.id, function(err, r){
if(err) {
logger.error(JSON.stringify(err))
return;
}
logger.info('destroyed' + ' ' + r.id.magenta)
});
});
});
};
resource.get(id, function(err, result){
if(err) {
logger.error(JSON.stringify(err))
return;
}
logger.info('showing ' + id.magenta);
cliff.putObject(result);
});
} else {
resource.get(id, function(err, record){
if(err) {
logger.error(JSON.stringify(err))
return;
}
logger.info('about to destroy ' + resource.name.magenta + ' ' + record.id);
cliff.putObject(record);
confirm(function(err, promptResult){
resource.destroy(record.id, function(err, r){
if(err) {
logger.error(JSON.stringify(err))
return;
}
logger.info('destroyed' + ' ' + record.id.magenta)
});
});
});
} else {