Skip to content

Commit

Permalink
Fix databaseHelper.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
aelassas committed Dec 4, 2024
1 parent 517afba commit f97ad63
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions api/src/common/databaseHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit f97ad63

Please sign in to comment.