mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-22 15:43:51 +00:00
Fix the access of results after API call
This commit is contained in:
@@ -96,14 +96,14 @@ onMounted(() => {
|
||||
const getAccompanyingPeriodWorks = (periodId: number) => {
|
||||
const url = `/api/1.0/person/accompanying-course/${periodId}/works.json`;
|
||||
|
||||
makeFetch<number, AccompanyingPeriodWork[]>("GET", url)
|
||||
makeFetch<number, {results: AccompanyingPeriodWork[]}>("GET", url)
|
||||
.then((response) => {
|
||||
if (props.isEvaluationSelector) {
|
||||
accompanyingPeriodWorks.value = response.filter(
|
||||
accompanyingPeriodWorks.value = response.results.filter(
|
||||
(acpw) => acpw.accompanyingPeriodWorkEvaluations.length > 0,
|
||||
);
|
||||
} else {
|
||||
accompanyingPeriodWorks.value = response;
|
||||
accompanyingPeriodWorks.value = response.results;
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
|
Reference in New Issue
Block a user