diff --git a/src/services/importService.ts b/src/services/importService.ts index 8d0ae9bf..3333ed0b 100644 --- a/src/services/importService.ts +++ b/src/services/importService.ts @@ -4,6 +4,7 @@ import { IMongoDate } from "../types/commonTypes"; import { equipmentKeys, IInventoryClient, + ISlots, IUpgradeClient, IUpgradeDatabase, IWeaponSkinClient, @@ -55,6 +56,11 @@ const replaceArray = (arr: T[], replacement: T[]): void => { }); }; +const replaceSlots = (db: ISlots, client: ISlots): void => { + db.Extra = client.Extra; + db.Slots = client.Slots; +}; + export const importInventory = (db: TInventoryDatabaseDocument, client: Partial): void => { for (const key of equipmentKeys) { if (client[key]) { @@ -67,4 +73,22 @@ export const importInventory = (db: TInventoryDatabaseDocument, client: Partial< if (client.Upgrades) { replaceArray(db.Upgrades, client.Upgrades.map(convertUpgrade)); } + for (const key of [ + "SuitBin", + "WeaponBin", + "SentinelBin", + "SpaceSuitBin", + "SpaceWeaponBin", + "PvpBonusLoadoutBin", + "PveBonusLoadoutBin", + "RandomModBin", + "MechBin", + "CrewMemberBin", + "OperatorAmpBin", + "CrewShipSalvageBin" + ] as const) { + if (client[key]) { + replaceSlots(db[key], client[key]); + } + } };