Skip to content

Commit

Permalink
use more precise typing
Browse files Browse the repository at this point in the history
  • Loading branch information
hotzevzl committed Jan 18, 2024
1 parent e701daf commit f3e89fb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ export class ProjectPlanningAreaAndGridController {
result.right.to,
);

req.query = result.right.query;
req.query = result.right.query as typeof req.query;

return await this.proxyService.proxyTileRequest(req, response);
}
Expand Down
13 changes: 8 additions & 5 deletions api/apps/api/src/modules/projects/projects.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ export class ProjectsService {
): Promise<
Either<
GetProjectErrors | typeof forbiddenError | typeof projectNotFound,
{ from: string; to: string; query: {} }
{ from: string; to: string; query: Record<string, unknown> }
>
> {
if (!(await this.projectAclService.canViewProject(userId, projectId))) {
Expand Down Expand Up @@ -890,10 +890,13 @@ export class ProjectsService {
**/
private idToGid(gid: string): PlanningGids {
const myArray = gid.split('.');
return myArray.reduce((acc: {}, curr: string, idx: number) => {
const key = idx === 0 ? 'countryId' : `adminAreaLevel${idx}Id`;
return { ...acc, [key]: curr };
}, {});
return myArray.reduce(
(acc: Record<string, unknown>, curr: string, idx: number) => {
const key = idx === 0 ? 'countryId' : `adminAreaLevel${idx}Id`;
return { ...acc, [key]: curr };
},
{},
);
}

async addProtectedAreaFor(
Expand Down

0 comments on commit f3e89fb

Please sign in to comment.