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 8f8a025 commit 3199c3e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/src/common/databaseHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,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 @@ -161,7 +161,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

0 comments on commit 3199c3e

Please sign in to comment.