22 lines
619 B
TypeScript
22 lines
619 B
TypeScript
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", {
|
|
params: {
|
|
id: axeId
|
|
}
|
|
})
|
|
.then((response) => {
|
|
response.data._embedded.questions.forEach(question => {
|
|
question.id = Number(question._links.self.href.split("/").reverse()[0]);
|
|
return question;
|
|
});
|
|
return response;
|
|
});
|
|
}
|
|
}
|