Skip to content

Commit

Permalink
fix: refresh structure instead of personne and structure
Browse files Browse the repository at this point in the history
  • Loading branch information
Quentin-Guillemin committed Dec 15, 2023
1 parent a384775 commit a3b1ef3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 6 additions & 2 deletions src/main/webapp/src/components/dialogs/AdditionalDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { setPersonneAdditional } from '@/services/personneService.ts';
import { useConfigurationStore } from '@/stores/configurationStore.ts';
import { useFonctionStore } from '@/stores/fonctionStore.ts';
import { usePersonneStore } from '@/stores/personneStore.ts';
import { useStructureStore } from '@/stores/structureStore.ts';
import { Tabs } from '@/types/enums/Tabs.ts';
import type { SimplePersonne } from '@/types/personneType.ts';
import { toIdentifier } from '@/utils/accountUtils.ts';
Expand All @@ -31,7 +32,7 @@ const fonctionStore = useFonctionStore();
const { customMapping } = storeToRefs(fonctionStore);
const personneStore = usePersonneStore();
const { initCurrentPersonne, refreshCurrentPersonne } = personneStore;
const { initCurrentPersonne } = personneStore;
const {
currentPersonne,
structureFonctions,
Expand All @@ -41,6 +42,9 @@ const {
administrativeList,
} = storeToRefs(personneStore);
const structureStore = useStructureStore();
const { refreshCurrentStructure } = structureStore;
const modelValue = computed<boolean>({
get() {
return isAdditional.value;
Expand Down Expand Up @@ -104,7 +108,7 @@ const closeAndResetModal = (success?: boolean) => {
const { i18n } = saveButton.value;
const title = i18n.replace('button.', '');
if (success) {
refreshCurrentPersonne();
refreshCurrentStructure();
toast.success(t(`toast.additional.success.${title}`));
} else if (!success && success != undefined) {
toast.error(t(`toast.additional.error.${title}`));
Expand Down
8 changes: 6 additions & 2 deletions src/main/webapp/src/components/dialogs/QuickAddDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import PersonneSearch from '@/components/search/PersonneSearch.vue';
import { setPersonneAdditionalWithCode, setPersonneAdditionalWithId } from '@/services/personneService.ts';
import { useConfigurationStore } from '@/stores/configurationStore.ts';
import { usePersonneStore } from '@/stores/personneStore.ts';
import { useStructureStore } from '@/stores/structureStore.ts';
import { toIdentifier } from '@/utils/accountUtils.ts';
import { errorHandler } from '@/utils/axiosUtils.ts';
import debounce from 'lodash.debounce';
Expand All @@ -19,9 +20,12 @@ const { isEditAllowed } = configurationStore;
const { currentStructureId, isQuickAdd, requestAdd } = storeToRefs(configurationStore);
const personneStore = usePersonneStore();
const { initCurrentPersonne, refreshCurrentPersonne } = personneStore;
const { initCurrentPersonne } = personneStore;
const { currentPersonne, structureFonctions, structureAdditionalFonctions } = storeToRefs(personneStore);
const structureStore = useStructureStore();
const { refreshCurrentStructure } = structureStore;
const modelValue = computed<boolean>({
get() {
return isQuickAdd.value;
Expand Down Expand Up @@ -71,7 +75,7 @@ const save = async () => {
const closeAndResetModal = (success?: boolean) => {
if (success) {
refreshCurrentPersonne();
refreshCurrentStructure();
toast.success(t('toast.additional.success.save'));
} else if (!success && success != undefined) {
toast.error(t('toast.additional.error.save'));
Expand Down

0 comments on commit a3b1ef3

Please sign in to comment.