Add new endpoints for activity types and frequencies, and implement email notifications for AM assignments
This commit is contained in:
@@ -550,4 +550,36 @@ export class HostService {
|
||||
});
|
||||
}
|
||||
|
||||
async getAllActivityTypesWithInterest(search?: string) {
|
||||
const where: any = {
|
||||
isActive: true,
|
||||
deletedAt: null,
|
||||
};
|
||||
|
||||
if (search && search.trim() !== '') {
|
||||
const q = search.trim();
|
||||
where.OR = [
|
||||
{ activityTypeName: { contains: q, mode: 'insensitive' } },
|
||||
{ interests: { interestName: { contains: q, mode: 'insensitive' } } },
|
||||
];
|
||||
}
|
||||
|
||||
return await this.prisma.activityTypes.findMany({
|
||||
where,
|
||||
select: {
|
||||
id: true,
|
||||
activityTypeName: true,
|
||||
interestXid: true,
|
||||
interests: {
|
||||
select: {
|
||||
id: true,
|
||||
interestName: true,
|
||||
displayOrder: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
orderBy: { activityTypeName: 'asc' },
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user