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:
Anik Dhabal Babu authored and GitHub committed 2025-05-23 17:53:40 -04:00
1 parent d1f7b043e8
commit ef1844557f
5 files changed
+232 -1

No files matched your search

+15
View File
@@ -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,
},
});
}
}