* Create `assignmentReasonRepository` * Write `assignmentReason` to booking * Type fix * Clean up --------- Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com>
17 lines
349 B
TypeScript
17 lines
349 B
TypeScript
import prisma from "@calcom/prisma";
|
|
|
|
export class AssignmentReasonRepository {
|
|
static async findLatestReasonFromBookingUid(bookingUid: string) {
|
|
return await prisma.assignmentReason.findFirst({
|
|
where: {
|
|
booking: {
|
|
uid: bookingUid,
|
|
},
|
|
},
|
|
orderBy: {
|
|
createdAt: "desc",
|
|
},
|
|
});
|
|
}
|
|
}
|