When unchecking the common schedule, schedule should be nulled (#6898)

This commit is contained in:
Alex van Andel authored and GitHub committed 2023-02-06 15:01:54 +01:00
1 parent c3d6df2dcf
commit 5b8ed9c3ef
4 files changed
+84 -62

No files matched your search

+1
View File
@@ -162,6 +162,7 @@ const loggedInViewerRouter = router({
avatar: user.avatar,
createdDate: user.createdDate,
trialEndsAt: user.trialEndsAt,
defaultScheduleId: user.defaultScheduleId,
completedOnboarding: user.completedOnboarding,
twoFactorEnabled: user.twoFactorEnabled,
disableImpersonation: user.disableImpersonation,
@@ -92,7 +92,7 @@ const EventTypeUpdateInput = _EventTypeModel
})
)
.optional(),
schedule: z.number().optional(),
schedule: z.number().nullable().optional(),
hashedLink: z.string(),
})
.partial()
@@ -564,6 +564,12 @@ export const eventTypesRouter = router({
};
}
}
// allows unsetting a schedule through { schedule: null, ... }
else if (null === schedule) {
data.schedule = {
disconnect: true,
};
}
if (users) {
data.users = {