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

For 3.9.6 #122

Merged
merged 10 commits into from
Aug 5, 2021
3 changes: 3 additions & 0 deletions caracal.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ var HANDLERS = {
"findMarkTypes": function() {
return dataHandlers.Mark.findMarkTypes;
},
"updateMarksLabel": function() {
return dataHandlers.Mark.updateMarksLabel;
},
"heatmapTypes": function() {
return dataHandlers.Heatmap.types;
},
Expand Down
19 changes: 19 additions & 0 deletions handlers/dataHandlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,26 @@ Mark.findMarkTypes = function(req, res, next) {
}).catch((e) => next(e));
}
};
Mark.updateMarksLabel = function(req, res, next) {
var query = req.query;
delete query.token;
// initial data

var newVals = {
$set: {
'provenance.analysis.name': query.name,
'properties.annotations.name': query.name,
'properties.annotations.notes': query.name,
},
};
mongoDB.update('camic', 'mark',
{
'provenance.analysis.labelId': query.id,
}, newVals).then((x) => {
req.data = x;
next();
}).catch((e) => next(e));
};
var Heatmap = {};
Heatmap.types = function(req, res, next) {
var query = req.query;
Expand Down
Loading