Skip to content

Commit

Permalink
refactor: Include partner institutions in get_all_activities_catalog …
Browse files Browse the repository at this point in the history
…response
  • Loading branch information
FelipeCarillo committed May 24, 2024
1 parent e6c0ea8 commit 0a2091d
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/core/repositories/database/repositories/ActivityRepo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -455,9 +455,6 @@ export class ActivityRepo implements IActivityRepo {

async get_all_activities_catalog(): Promise<{ title: string; logo: string; type_activity: ActivityTypeEnum; }[]> {
const response = await ActivityDB.findAll({
attributes: {
exclude: ['description', 'start_date', 'end_date', 'created_at', 'updated_at']
},
include: [{
model: ActivityPartnerInstitution, as: 'partner_institutions',
include: [{
Expand All @@ -466,13 +463,14 @@ export class ActivityRepo implements IActivityRepo {
include: [{
model: InstitutionImageDB, as: 'images',
limit: 1,
order: [['id', 'ASC']],
attributes: ['image']
order: [['id', 'ASC']]
}]
}]
}],
where: {
status_id: [ActivityStatusEnum.ACTIVE, ActivityStatusEnum.TO_START]
status_id: {
[Op.or]: [ActivityStatusEnum.ACTIVE, ActivityStatusEnum.TO_START]
}
},
order: [
['start_date', 'ASC']
Expand Down

0 comments on commit 0a2091d

Please sign in to comment.