use fetchResult instead of makeFetch for acpw creation

This commit is contained in:
Julie Lenaerts 2025-02-27 16:16:54 +01:00
parent 046d3ec9f1
commit 8c8c16c1a1

View File

@ -6,7 +6,7 @@ import {
} from "ChillMainAssets/chill/js/date";
import { findSocialActionsBySocialIssue } from "ChillPersonAssets/vuejs/_api/SocialWorkSocialAction.js";
// import { create } from 'ChillPersonAssets/vuejs/_api/AccompanyingCourseWork.js';
import { makeFetch } from "ChillMainAssets/lib/api/apiMethods";
import {fetchResults, makeFetch} from "ChillMainAssets/lib/api/apiMethods";
const debug = process.env.NODE_ENV !== "production";
@ -168,13 +168,13 @@ const store = createStore({
},
fetchOtherSocialIssues({ commit }) {
const url = `/api/1.0/person/social-work/social-issue.json`;
return makeFetch("GET", url)
.then((response) => {
commit("updateIssuesOther", response.results);
})
.catch((error) => {
throw error;
});
return fetchResults(url)
.then((response) => {
commit("updateIssuesOther", response); // Directly commit the array of issues
})
.catch((error) => {
throw error;
});
},
},
});