From 9ea7989888f52a5f58e7ae0c67cf044080455446 Mon Sep 17 00:00:00 2001 From: aelassas Date: Wed, 4 Dec 2024 08:03:15 +0100 Subject: [PATCH] Fix databaseHelper.ts --- api/src/common/databaseHelper.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/src/common/databaseHelper.ts b/api/src/common/databaseHelper.ts index 70a992b02..c148b388a 100644 --- a/api/src/common/databaseHelper.ts +++ b/api/src/common/databaseHelper.ts @@ -102,7 +102,7 @@ const initializeLocations = async () => { const values = await LocationValue.find({ language: { $nin: env.LANGUAGES } }) const valuesIds = values.map((v) => v.id) for (const val of values) { - const _locations = await Location.find({ values: val._id }).lean() + const _locations = await Location.find({ values: val.id }) for (const _loc of _locations) { const loc = await Location.findById(_loc.id) if (loc) { @@ -163,7 +163,7 @@ const initializeCountries = async () => { const values = await LocationValue.find({ language: { $nin: env.LANGUAGES } }) const valuesIds = values.map((v) => v.id) for (const val of values) { - const _countries = await Country.find({ values: val._id }).lean() + const _countries = await Country.find({ values: val.id }) for (const _country of _countries) { const country = await Country.findById(_country.id) if (country) { @@ -224,7 +224,7 @@ const initializeParkingSpots = async () => { const values = await LocationValue.find({ language: { $nin: env.LANGUAGES } }) const valuesIds = values.map((v) => v.id) for (const val of values) { - const _parkingSpots = await ParkingSpot.find({ values: val._id }).lean() + const _parkingSpots = await ParkingSpot.find({ values: val.id }) for (const _parkingSpot of _parkingSpots) { const parkingSpot = await ParkingSpot.findById(_parkingSpot.id) if (parkingSpot) {