fix: correct id compute
This commit is contained in:
@@ -127,7 +127,6 @@ export default class Login extends Vue {
|
||||
saveResult() {
|
||||
const responsesFormatted: { score: number; comment?: string; questionId: number }[] = [];
|
||||
quizStore.responses.forEach((value, key) => {
|
||||
console.info(key, value);
|
||||
responsesFormatted.push({
|
||||
score: value.score ? value.score : 0,
|
||||
comment: value.comment,
|
||||
|
@@ -12,8 +12,7 @@ export default {
|
||||
})
|
||||
.then((response) => {
|
||||
response.data._embedded.questions.forEach(question => {
|
||||
console.info(question._links.self.href, question, $axios.defaults.baseURL + "/questions/");
|
||||
question.id = Number(question._links.self.href.replace($axios.defaults.baseURL + "/questions/", ""));
|
||||
question.id = Number(question._links.self.href.split("/").reverse()[0]);
|
||||
return question;
|
||||
});
|
||||
return response;
|
||||
|
@@ -12,7 +12,7 @@ export default {
|
||||
})
|
||||
.then((response) => {
|
||||
response.data._embedded.quizzes.map(quiz => {
|
||||
quiz.id = Number(quiz._links.self.href.replace($axios.defaults.baseURL + "/quizzes/", ""));
|
||||
quiz.id = Number(quiz._links.self.href.split("").reverse()[0]);
|
||||
return quiz;
|
||||
});
|
||||
return response;
|
||||
|
@@ -47,7 +47,6 @@ export default class Quiz extends VuexModule {
|
||||
score: response.score
|
||||
});
|
||||
}
|
||||
console.info(this.responses);
|
||||
const questionsRated = this.questionsRatedPerAxe.get(response.axeId);
|
||||
if (questionsRated) {
|
||||
questionsRated
|
||||
|
Reference in New Issue
Block a user