feat: review model to retrieve all the questions with a single query
- update initial data - add description field to the axe
This commit is contained in:
@@ -37,7 +37,7 @@ import {Component, Vue} from "vue-property-decorator";
|
||||
import {AxiosResponse} from "axios";
|
||||
import {RepositoryFactory} from "~/repositories/RepositoryFactory";
|
||||
import {RestResponse} from "~/repositories/models/rest-response.model";
|
||||
import {Quiz, Score} from "~/repositories/models/quiz.model";
|
||||
import {Quiz} from "~/repositories/models/quiz.model";
|
||||
|
||||
@Component
|
||||
export default class History extends Vue {
|
||||
@@ -52,12 +52,6 @@ export default class History extends Vue {
|
||||
await this.quizRepository.findMine().then((response: AxiosResponse<RestResponse<Quiz>>) => {
|
||||
this.quizzes = response.data._embedded.quizzes;
|
||||
});
|
||||
for (const quiz of this.quizzes) {
|
||||
await this.quizRepository.findScores(quiz.id)
|
||||
.then((value: AxiosResponse<Score[]>) => {
|
||||
quiz.scores = value.data;
|
||||
});
|
||||
}
|
||||
this.currentResult = this.quizzes.length > 0 ? this.quizzes[0] : null;
|
||||
this.loading = false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user