mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-08 17:03:53 +00:00
refactor: simplify logic
This commit is contained in:
@@ -108,7 +108,7 @@ export async function deleteEvent(eventIds: string[]) {
|
||||
const scopedMutation = cache.mutateCache(cache.remove);
|
||||
const { didMutate } = await scopedMutation({ eventIds });
|
||||
|
||||
if (didMutate === false) {
|
||||
if (!didMutate) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@ export async function editEvent(patch: PatchWithId) {
|
||||
const { newEvent, didMutate } = await scopedMutation({ patch, eventId: patch.id });
|
||||
|
||||
// short circuit if nothing changed
|
||||
if (didMutate === false) {
|
||||
if (!didMutate) {
|
||||
return newEvent;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user