LT-293: send proper timepoint id to server when removing an association and update the view, removing this associations

This commit is contained in:
Eloízio Salgado authored and Erik Ziegler committed 2016-11-15 08:25:09 +01:00
1 parent 998cdce9fb
commit 987be26047
5 files changed
+90 -23

No files matched your search

@@ -59,6 +59,45 @@ class TimepointApi {
storeFn(timepointData).then(() => OHIF.log.info('Timepoint storage completed'));
}
removeTimepoint(timepointId) {
const removeFn = configuration.dataExchange.remove;
if (!_.isFunction(removeFn)) {
return;
}
const timepointData = {
timepointId
};
OHIF.log.info('Preparing to remove timepoint');
OHIF.log.info(JSON.stringify(timepointData, null, 2));
removeFn(timepointData).then(() => {
OHIF.log.info('Timepoint removal completed');
this.timepoints.remove(timepointData);
});
}
updateTimepoint(timepointId, query) {
const updateFn = configuration.dataExchange.update;
if (!_.isFunction(updateFn)) {
return;
}
const timepointData = {
timepointId
};
OHIF.log.info('Preparing to update timepoint');
OHIF.log.info(JSON.stringify(timepointData, null, 2));
OHIF.log.info(JSON.stringify(query, null, 2));
updateFn(timepointData, query).then(() => {
OHIF.log.info('Timepoint updated completed');
this.timepoints.update(timepointData, query);
});
}
// Return all timepoints
all() {
return this.timepoints.find().fetch();