diff --git a/assets/vue/components/page/Form.vue b/assets/vue/components/page/Form.vue index 6bbfdf2e57..b89e7392b0 100644 --- a/assets/vue/components/page/Form.vue +++ b/assets/vue/components/page/Form.vue @@ -122,6 +122,7 @@ import useVuelidate from '@vuelidate/core'; import { required } from '@vuelidate/validators'; import isEmpty from 'lodash/isEmpty'; import { useI18n } from 'vue-i18n'; +import pageCategoryService from "../../services/pageCategoryService" const props = defineProps({ modelValue: { @@ -143,12 +144,9 @@ let locales = ref([]); let categories = ref([]); locales.value = window.languages.map(locale => locale.isocode); -store.dispatch('pagecategory/findAll') - .then((response) => { - categories.value = response.map(data => data); - }); +const findAllPageCategories = async () => categories.value = await pageCategoryService.findAll() -const currentUser = computed(() => store.getters['security/getUser']); +findAllPageCategories() watch( () => props.modelValue, diff --git a/assets/vue/main.js b/assets/vue/main.js index 2fb69fde98..8d182c597d 100644 --- a/assets/vue/main.js +++ b/assets/vue/main.js @@ -23,7 +23,6 @@ import userRelUserService from "./services/userreluser" import calendarEventService from "./services/ccalendarevent" import toolIntroService from "./services/ctoolintro" import pageService from "./services/page" -import pageCategoryService from "./services/pagecategory" import sessionService from "./services/session" import socialPostService from "./services/socialpost" @@ -102,13 +101,6 @@ store.registerModule( }), ) -store.registerModule( - "pagecategory", - makeCrudModule({ - service: pageCategoryService, - }), -) - store.registerModule( "session", makeCrudModule({ diff --git a/assets/vue/services/pageCategoryService.js b/assets/vue/services/pageCategoryService.js new file mode 100644 index 0000000000..66f2dfd757 --- /dev/null +++ b/assets/vue/services/pageCategoryService.js @@ -0,0 +1,10 @@ +import {ENTRYPOINT} from "../config/entrypoint" +import axios from "axios" + +export default { + findAll: async () => { + const response = await axios.get(ENTRYPOINT + 'page_categories') + + return response.data['hydra:member'] + }, +} diff --git a/assets/vue/services/pagecategory.js b/assets/vue/services/pagecategory.js deleted file mode 100644 index 929b6ea9c9..0000000000 --- a/assets/vue/services/pagecategory.js +++ /dev/null @@ -1,3 +0,0 @@ -import makeService from './api'; - -export default makeService('page_categories');