fix: correct typing issue
parent
6bf5963b83
commit
c4dbdd05e0
|
@ -1,16 +1,17 @@
|
|||
import {AxiosResponse} from "axios";
|
||||
import {$axios} from "~/utils/api";
|
||||
import {RestResponse} from "~/repositories/models/rest-response.model";
|
||||
import {Question} from "~/repositories/models/question.model";
|
||||
|
||||
export default {
|
||||
findAllByAxeId(axeId: number) {
|
||||
return $axios.get<RestResponse<Question>>("/questions/search/byAxeId", {
|
||||
return $axios
|
||||
.get<RestResponse<Question>>("/questions/search/byAxeId", {
|
||||
params: {
|
||||
id: axeId
|
||||
}
|
||||
}).then((response: AxiosResponse<RestResponse<Question>>) => {
|
||||
response.data._embedded.questions.map(question => {
|
||||
})
|
||||
.then((response) => {
|
||||
response.data._embedded.questions.forEach(question => {
|
||||
question.id = Number(question._links.self.href.replace($axios.defaults.baseURL + "/questions/", ""));
|
||||
return question;
|
||||
});
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
import {AxiosResponse} from "axios";
|
||||
import {$axios} from "~/utils/api";
|
||||
import {RestResponse} from "~/repositories/models/rest-response.model";
|
||||
import {Quiz, Response, ResponseWithQuestion, Score} from "~/repositories/models/quiz.model";
|
||||
|
@ -11,7 +10,7 @@ export default {
|
|||
sort: "createdDate,desc"
|
||||
}
|
||||
})
|
||||
.then((response: AxiosResponse<RestResponse<Quiz>>) => {
|
||||
.then((response) => {
|
||||
response.data._embedded.quizzes.map(quiz => {
|
||||
quiz.id = Number(quiz._links.self.href.replace($axios.defaults.baseURL + "/quizzes/", ""));
|
||||
return quiz;
|
||||
|
|
Loading…
Reference in New Issue