2022-10-10 08:29:25 +00:00
|
|
|
import {$axios} from "~/utils/api";
|
2022-10-07 14:15:53 +00:00
|
|
|
import {RestResponse} from "~/repositories/models/rest-response.model";
|
|
|
|
import {Question} from "~/repositories/models/question.model";
|
|
|
|
|
|
|
|
export default {
|
|
|
|
findAllByAxeId(axeId: number) {
|
2022-10-10 08:46:32 +00:00
|
|
|
return $axios
|
|
|
|
.get<RestResponse<Question>>("/questions/search/byAxeId", {
|
|
|
|
params: {
|
|
|
|
id: axeId
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.then((response) => {
|
|
|
|
response.data._embedded.questions.forEach(question => {
|
2022-10-10 13:43:16 +00:00
|
|
|
console.info(question._links.self.href, question, $axios.defaults.baseURL + "/questions/");
|
2022-10-10 08:29:25 +00:00
|
|
|
question.id = Number(question._links.self.href.replace($axios.defaults.baseURL + "/questions/", ""));
|
|
|
|
return question;
|
|
|
|
});
|
|
|
|
return response;
|
2022-10-07 14:15:53 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|