Skip to content

Commit

Permalink
Update databaseHelper.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
aelassas committed Jan 7, 2025
1 parent 272e9c4 commit e3a0147
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions api/src/common/databaseHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,16 +223,18 @@ const createCollection = async<T>(model: Model<T>) => {
*/
export const initialize = async (): Promise<boolean> => {
try {
await createCollection<env.Booking>(Booking)
await createCollection<env.LocationValue>(LocationValue)
await createCollection<env.Country>(Country)
await createCollection<env.Location>(Location)
await createCollection<env.Notification>(Notification)
await createCollection<env.NotificationCounter>(NotificationCounter)
await createCollection<env.Property>(Property)
await createCollection<env.PushToken>(PushToken)
await createCollection<env.Token>(Token)
await createCollection<env.User>(User)
if (mongoose.connection.readyState) {
await createCollection<env.Booking>(Booking)
await createCollection<env.LocationValue>(LocationValue)
await createCollection<env.Country>(Country)
await createCollection<env.Location>(Location)
await createCollection<env.Notification>(Notification)
await createCollection<env.NotificationCounter>(NotificationCounter)
await createCollection<env.Property>(Property)
await createCollection<env.PushToken>(PushToken)
await createCollection<env.Token>(Token)
await createCollection<env.User>(User)
}

//
// Update Booking TTL index if configuration changes
Expand Down

0 comments on commit e3a0147

Please sign in to comment.