refactor: simplify schedule filtering logic in ScheduleSchema
- Replace complex where clause with a direct reference to args.filter for schedule retrieval. - This change enhances code readability and maintainability by streamlining the filtering process.
This commit is contained in:
@@ -278,21 +278,7 @@ export class ScheduleSchema extends PothosSchema {
|
||||
skip: args.skip ?? undefined,
|
||||
take: args.take ?? undefined,
|
||||
orderBy: args.orderBy ?? undefined,
|
||||
where: {
|
||||
AND: [
|
||||
{
|
||||
OR: [
|
||||
{ managedService: { service: { centerId: center.id } } },
|
||||
{
|
||||
managedService: {
|
||||
service: { center: { centerMentors: { some: { mentorId: ctx.http.me.id } } } },
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{ managedService: { service: { centerId: center.id } } },
|
||||
],
|
||||
},
|
||||
where: args.filter ?? undefined,
|
||||
})
|
||||
},
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user