fix loading of evaluations

This commit is contained in:
2022-01-26 21:46:07 +01:00
parent dc0fae7549
commit c70a4dc664
5 changed files with 17 additions and 7 deletions

View File

@@ -58,7 +58,11 @@ const store = createStore({
return state.thirdParties.length > 0;
},
getTemplatesAvailablesForEvaluation: (state) => (evaluation) => {
return state.templatesAvailablesForEvaluation.get(evaluation.id) || [];
if (state.templatesAvailablesForEvaluation.has(evaluation.id)) {
return state.templatesAvailablesForEvaluation.get(evaluation.id);
}
return [];
},
buildPayload(state) {
return {
@@ -171,7 +175,6 @@ const store = createStore({
};
g.id = tmpIndex() -1
state.goalsPicked.push(g);
//console.log('goals picked ids', state.goalsPicked.map(g => g.id))
},
removeGoal(state, goal) {
state.goalsPicked = state.goalsPicked.filter(g => g.id !== goal.id);
@@ -369,7 +372,6 @@ const store = createStore({
return makeFetch('PUT', url, payload)
.then(data => {
console.log('data received', data);
if (typeof(callback) !== 'undefined') {
return callback(data);
} else {