Skip to content

Commit

Permalink
feat(projects): include custom protected areas
Browse files Browse the repository at this point in the history
  • Loading branch information
kgajowy committed Sep 13, 2021
1 parent 6a53552 commit a2e3d2b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions api/apps/api/src/modules/projects/projects-crud.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,17 @@ export class ProjectsCrudService extends AppBaseService<
entity.planningAreaId = idAndName.planningAreaId;
entity.planningAreaName = idAndName.planningAreaName;
}

const customProtectedAreas = await this.protectedAreas.find({
where: {
projectId: entity.id,
},
});
entity.customProtectedAreas = customProtectedAreas.map((area) => ({
name: area.fullName ?? undefined,
id: area.id,
}));

return entity;
}

Expand Down

0 comments on commit a2e3d2b

Please sign in to comment.