Fix: availability not deleteable (#8086)
* fix: make availability deletable * test: add e2e * chore: add test id * test: add a new test * fix: remove utility
This commit is contained in:
1 parent
e043a5efd8
commit
6986b5af40
4 files changed
+35
-14
No files matched your search
@@ -92,14 +92,9 @@ export function AvailabilityList({ schedules }: RouterOutputs["viewer"]["availab
|
||||
}}
|
||||
key={schedule.id}
|
||||
schedule={schedule}
|
||||
isDeletable={schedules.length !== 1}
|
||||
updateDefault={updateMutation.mutate}
|
||||
deleteFunction={() => {
|
||||
if (schedules.length === 1) {
|
||||
showToast(t("requires_at_least_one_schedule"), "error");
|
||||
} else {
|
||||
deleteMutation.mutate;
|
||||
}
|
||||
}}
|
||||
deleteFunction={deleteMutation.mutate}
|
||||
/>
|
||||
))}
|
||||
</ul>
|
||||
|
||||
Reference in new issue
Block a user