fix: Host schedule not updating upon updating/deleting default schedule (#20750)
* fix: host schdule not updating * Update util.ts * tweak * Update delete.handler.ts * add test * update * Update util.test.ts
This commit is contained in:
1 parent
d1f7b043e8
commit
ef1844557f
5 files changed
+232
-1
No files matched your search
@@ -0,0 +1,15 @@
|
||||
import prisma from "@calcom/prisma";
|
||||
|
||||
export class HostRepository {
|
||||
static async updateHostsSchedule(userId: number, oldScheduleId: number, newScheduleId: number) {
|
||||
return await prisma.host.updateMany({
|
||||
where: {
|
||||
userId,
|
||||
scheduleId: oldScheduleId,
|
||||
},
|
||||
data: {
|
||||
scheduleId: newScheduleId,
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user