fix: fixed delete event and dated value when excluding a day
gitea/salix-front/pipeline/pr-master This commit looks good
Details
gitea/salix-front/pipeline/pr-master This commit looks good
Details
This commit is contained in:
parent
e10e0d01e6
commit
07ba02aec8
|
@ -1,5 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed, onMounted } from 'vue';
|
import { ref, computed, onMounted, reactive } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ const { t } = useI18n();
|
||||||
const { openConfirmationModal } = useVnConfirm();
|
const { openConfirmationModal } = useVnConfirm();
|
||||||
|
|
||||||
const isNew = computed(() => props.isNewMode);
|
const isNew = computed(() => props.isNewMode);
|
||||||
const dated = ref(props.date);
|
const dated = reactive(props.date);
|
||||||
const tickedNodes = ref();
|
const tickedNodes = ref();
|
||||||
|
|
||||||
const _excludeType = ref('all');
|
const _excludeType = ref('all');
|
||||||
|
@ -68,12 +68,11 @@ const exclusionGeoCreate = async () => {
|
||||||
|
|
||||||
const exclusionCreate = async () => {
|
const exclusionCreate = async () => {
|
||||||
if (isNew.value)
|
if (isNew.value)
|
||||||
await axios.post(`Zones/${route.params.id}/exclusions`, [{ dated: dated.value }]);
|
await axios.post(`Zones/${route.params.id}/exclusions`, [{ dated: dated }]);
|
||||||
else
|
else
|
||||||
await axios.post(`Zones/${route.params.id}/exclusions`, {
|
await axios.post(`Zones/${route.params.id}/exclusions`, {
|
||||||
dated: dated.value,
|
dated: dated,
|
||||||
});
|
});
|
||||||
|
|
||||||
await refetchEvents();
|
await refetchEvents();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -84,7 +83,8 @@ const onSubmit = async () => {
|
||||||
|
|
||||||
const deleteEvent = async () => {
|
const deleteEvent = async () => {
|
||||||
if (!props.event) return;
|
if (!props.event) return;
|
||||||
await axios.delete(`Zones/${route.params.id}/exclusions`);
|
const exclusionId = props.event?.zoneExclusionFk || props.event?.id;
|
||||||
|
await axios.delete(`Zones/${route.params.id}/exclusions/${exclusionId}`);
|
||||||
await refetchEvents();
|
await refetchEvents();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue