diff --git a/src/store/modules/settings.js b/src/store/modules/settings.js index c4457b9b..0a583b90 100644 --- a/src/store/modules/settings.js +++ b/src/store/modules/settings.js @@ -1,4 +1,5 @@ import { defineStore } from 'pinia' +import { generateUrl } from '@nextcloud/router' export const useSettingsStore = defineStore('settings', { state: () => ({ @@ -23,7 +24,7 @@ export const useSettingsStore = defineStore('settings', { this.error = null try { - const response = await fetch('/apps/procest/api/settings', { + const response = await fetch(generateUrl('/apps/procest/api/settings'), { method: 'GET', headers: { 'Content-Type': 'application/json', @@ -57,7 +58,7 @@ export const useSettingsStore = defineStore('settings', { this.error = null try { - const response = await fetch('/apps/procest/api/settings', { + const response = await fetch(generateUrl('/apps/procest/api/settings'), { method: 'POST', headers: { 'Content-Type': 'application/json', diff --git a/src/store/modules/zgwMapping.js b/src/store/modules/zgwMapping.js index c3ccec41..f2c8a82e 100644 --- a/src/store/modules/zgwMapping.js +++ b/src/store/modules/zgwMapping.js @@ -1,4 +1,5 @@ import { defineStore } from 'pinia' +import { generateUrl } from '@nextcloud/router' export const useZgwMappingStore = defineStore('zgwMapping', { state: () => ({ @@ -17,7 +18,7 @@ export const useZgwMappingStore = defineStore('zgwMapping', { this.error = null try { - const response = await fetch('/apps/procest/api/zgw-mappings', { + const response = await fetch(generateUrl('/apps/procest/api/zgw-mappings'), { method: 'GET', headers: { 'Content-Type': 'application/json', @@ -47,7 +48,7 @@ export const useZgwMappingStore = defineStore('zgwMapping', { this.error = null try { - const response = await fetch(`/apps/procest/api/zgw-mappings/${resourceKey}`, { + const response = await fetch(generateUrl(`/apps/procest/api/zgw-mappings/${resourceKey}`), { method: 'PUT', headers: { 'Content-Type': 'application/json', @@ -78,7 +79,7 @@ export const useZgwMappingStore = defineStore('zgwMapping', { this.error = null try { - const response = await fetch(`/apps/procest/api/zgw-mappings/${resourceKey}/reset`, { + const response = await fetch(generateUrl(`/apps/procest/api/zgw-mappings/${resourceKey}/reset`), { method: 'POST', headers: { 'Content-Type': 'application/json', diff --git a/src/views/settings/AdminRoot.vue b/src/views/settings/AdminRoot.vue index f89b0105..03e358b8 100644 --- a/src/views/settings/AdminRoot.vue +++ b/src/views/settings/AdminRoot.vue @@ -76,6 +76,7 @@ import CaseTypeAdmin from './CaseTypeAdmin.vue' import ZgwMappingSettings from './ZgwMappingSettings.vue' import MapLayerSettings from './MapLayerSettings.vue' import AiSettingsTab from './tabs/AiSettingsTab.vue' +import { generateUrl } from '@nextcloud/router' import { initializeStores } from '../../store/store.js' export default { @@ -112,7 +113,7 @@ export default { this.message = '' try { - const response = await fetch('/apps/procest/api/settings/load', { + const response = await fetch(generateUrl('/apps/procest/api/settings/load'), { method: 'POST', headers: { 'Content-Type': 'application/json', diff --git a/src/views/voorstellen/VoorstelList.vue b/src/views/voorstellen/VoorstelList.vue index 7f88f443..59790d9e 100644 --- a/src/views/voorstellen/VoorstelList.vue +++ b/src/views/voorstellen/VoorstelList.vue @@ -106,6 +106,7 @@ import { NcButton, NcEmptyContent, NcLoadingIcon } from '@nextcloud/vue' import FileDocumentEditOutline from 'vue-material-design-icons/FileDocumentEditOutline.vue' import BellRing from 'vue-material-design-icons/BellRing.vue' import VoorstelCreateDialog from './components/VoorstelCreateDialog.vue' +import { generateUrl } from '@nextcloud/router' import { useObjectStore } from '../../store/modules/object.js' const STATUS_LABELS = { @@ -255,7 +256,7 @@ export default { async sendReminder(voorstel) { const actor = this.getWaitingActor(voorstel) try { - await fetch('/apps/procest/api/notifications/parafering-reminder', { + await fetch(generateUrl('/apps/procest/api/notifications/parafering-reminder'), { method: 'POST', headers: { 'Content-Type': 'application/json',