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