0
0
Fork 0

fix: fixed exclusionCreate when excluding an event already excluded

This commit is contained in:
Jon Elias 2024-11-28 07:21:02 +01:00
parent e94c99662d
commit 1a0406b5b1
1 changed files with 6 additions and 1 deletions

View File

@ -67,7 +67,12 @@ const exclusionGeoCreate = async () => {
};
const exclusionCreate = async () => {
await axios.post(`Zones/${route.params.id}/exclusions`, [{ dated: dated }]);
if (isNew.value)
await axios.post(`Zones/${route.params.id}/exclusions`, [{ dated: dated }]);
else
await axios.put(`Zones/${route.params.id}/exclusions/${props.event?.id}`, {
dated: dated,
});
await refetchEvents();
};