From d00248e4311f97d712e6cde2b2022c1b50272160 Mon Sep 17 00:00:00 2001 From: aelassas Date: Sat, 16 Nov 2024 18:01:00 +0100 Subject: [PATCH] Fix db.ts --- api/scripts/db.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/scripts/db.ts b/api/scripts/db.ts index 9557d903d..bef90cceb 100644 --- a/api/scripts/db.ts +++ b/api/scripts/db.ts @@ -10,8 +10,8 @@ if ( const cars = await Car.find({}) for (const car of cars) { - if (car.price) { - car.dailyPrice = car.price + if (('price' in car) && car.price) { + car.dailyPrice = Number(car.price) car.discountedDailyPrice = null car.biWeeklyPrice = null car.discountedBiWeeklyPrice = null