Open mspanish opened 7 years ago
Got it working! Created a simple route like this:
exports.removeColor = function (req, res) {
var primaryKey = req.body.primary;
var db = req.body.db;
var table = req.body.table;
var colors = req.body.colors;
r.db(db).table(table).get(primaryKey).update({colors:colors}).run( connection, {timeFormat: 'raw'}, function(error, result) {
if (error) handleError(error);
res.json({
error: error,
result: result
});
})
}
Then when I click on a color, I pass the id and the new color array (I added lodash to the front end to do that quickly).
Hello and thanks again for this great app! I've hacked it up so that I can view colors from arrays inside of fields, and I'm planning to try and expose a new route that deletes any color I click on. Hackish I know! But would serve my needs for now. Is there any better way to do this? If anybody wants my hack I'll post it - here's a screenshot.