diff --git a/src/services/importService.ts b/src/services/importService.ts index 1be3be34..18375680 100644 --- a/src/services/importService.ts +++ b/src/services/importService.ts @@ -58,8 +58,7 @@ import { IPlanterClient, IPlanterDatabase, ITailorShop, - ITailorShopDatabase, - TPersonalRoomsDatabaseDocument + ITailorShopDatabase } from "@/src/types/personalRoomsTypes"; const convertDate = (value: IMongoDate): Date => { @@ -450,12 +449,10 @@ export const importLoadOutPresets = (db: ILoadoutDatabase, client: ILoadOutPrese const convertShip = (client: IOrbiterClient): IOrbiterDatabase => { return { ...client, - ShipInterior: client.ShipInterior - ? { - ...client.ShipInterior, - Colors: Array.isArray(client.ShipInterior.Colors) ? {} : client.ShipInterior.Colors - } - : undefined, + ShipInterior: { + ...client.ShipInterior, + Colors: Array.isArray(client.ShipInterior.Colors) ? {} : client.ShipInterior.Colors + }, FavouriteLoadoutId: client.FavouriteLoadoutId ? new Types.ObjectId(client.FavouriteLoadoutId.$oid) : undefined }; }; @@ -484,8 +481,8 @@ const convertFavouriteLoadout = (client: IFavouriteLoadout): IFavouriteLoadoutDa const convertApartment = (client: IApartmentClient): IApartmentDatabase => { return { ...client, - Gardening: client.Gardening ? { Planters: client.Gardening.Planters.map(convertPlanter) } : { Planters: [] }, - FavouriteLoadouts: client.FavouriteLoadouts ? client.FavouriteLoadouts.map(convertFavouriteLoadout) : [] + Gardening: { Planters: client.Gardening.Planters.map(convertPlanter) }, + FavouriteLoadouts: client.FavouriteLoadouts.map(convertFavouriteLoadout) }; }; @@ -493,7 +490,7 @@ const convertTailorShop = (client: ITailorShop): ITailorShopDatabase => { return { ...client, Colors: Array.isArray(client.Colors) ? {} : client.Colors, - FavouriteLoadouts: client.FavouriteLoadouts ? client.FavouriteLoadouts.map(convertFavouriteLoadout) : [] + FavouriteLoadouts: client.FavouriteLoadouts.map(convertFavouriteLoadout) }; };