forked from verdnatura/salix-front
fix: fixed exclusionCreate when excluding an event already excluded
This commit is contained in:
parent
e94c99662d
commit
1a0406b5b1
|
@ -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();
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue