Fix overwriting users column when saving event types (#7445)

* Only overwrite user column when present

* Clean up
This commit is contained in:
Joe Au-Yeung authored and GitHub committed 2023-03-01 10:16:04 -07:00
1 parent a6cd173910
commit 7b1ced914b
2 files changed
+28 -8

No files matched your search

@@ -604,7 +604,7 @@ export const eventTypesRouter = router({
};
}
if (users) {
if (users.length) {
data.users = {
set: [],
connect: users.map((userId: number) => ({ id: userId })),