Skip to content

Commit

Permalink
don't return noiseLevel and residentialSituation if they're null
Browse files Browse the repository at this point in the history
  • Loading branch information
tlmn committed May 30, 2024
1 parent 9aeed62 commit 1d54f56
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,12 @@ app.get("/:rentIndexYear/residentialStatus", (req: Request, res: Response) => {
district: result.district,
eastWest: result.eastWest,
objectStatus: result.objectStatus,
noiseLevel: convertBooleanString(result.noiseLevel),
residentialSituation: result.residentialSituation,
...(result.noiseLevel !== null && {
noiseLevel: convertBooleanString(result.noiseLevel),
}),
...(result.residentialSituation !== null && {
residentialSituation: result.residentialSituation,
}),
houseNumberRange,
},
});
Expand Down

0 comments on commit 1d54f56

Please sign in to comment.