Skip to content

Commit

Permalink
fix: renamed route variables
Browse files Browse the repository at this point in the history
  • Loading branch information
cephaschapa committed Apr 15, 2024
1 parent df90396 commit 952549c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/src/app/api/v0/city/[city]/population/[year]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ export const GET = apiHandler(async (_req: Request, { session, params }) => {
const population = await db.models.Population.findAll({
where: { cityId: city?.cityId },
});
const populationEntry: PopulationEntry[] = population.map(({population, year})=>{
const populations: PopulationEntry[] = population.map(({population, year})=>{
return {
year,
population: population!
}
})

const allPopulationData = findClosestYearToInventory(populationEntry, parseInt(params.year))
return NextResponse.json({ data: allPopulationData });
const closestYearPopulationData = findClosestYearToInventory(populations, parseInt(params.year))
return NextResponse.json({ data: closestYearPopulationData });
});

0 comments on commit 952549c

Please sign in to comment.