From 8c8c16c1a18c767c7655a3cf404f0c708a756320 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Thu, 27 Feb 2025 16:16:54 +0100 Subject: [PATCH] use fetchResult instead of makeFetch for acpw creation --- .../vuejs/AccompanyingCourseWorkCreate/store.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkCreate/store.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkCreate/store.js index 21015cdc3..72f4eb6d0 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkCreate/store.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkCreate/store.js @@ -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; + }); }, }, });