* fix: host schdule not updating * Update util.ts * tweak * Update delete.handler.ts * add test * update * Update util.test.ts
16 lines
356 B
TypeScript
16 lines
356 B
TypeScript
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,
|
|
},
|
|
});
|
|
}
|
|
}
|