rename IInventoryResponse to IInventoryClient
This commit is contained in:
parent
79cf50b9ae
commit
394dc4c304
@ -4,7 +4,7 @@ import { Inventory } from "@/src/models/inventoryModels/inventoryModel";
|
||||
import { config } from "@/src/services/configService";
|
||||
import allDialogue from "@/static/fixed_responses/allDialogue.json";
|
||||
import { ILoadoutDatabase } from "@/src/types/saveLoadoutTypes";
|
||||
import { IInventoryResponse, IShipInventory, equipmentKeys } from "@/src/types/inventoryTypes/inventoryTypes";
|
||||
import { IInventoryClient, IShipInventory, equipmentKeys } from "@/src/types/inventoryTypes/inventoryTypes";
|
||||
import { IPolarity, ArtifactPolarity, EquipmentFeatures } from "@/src/types/inventoryTypes/commonInventoryTypes";
|
||||
import {
|
||||
ExportCustoms,
|
||||
@ -55,7 +55,7 @@ export const inventoryController: RequestHandler = async (request, response) =>
|
||||
const inventoryWithLoadOutPresetsAndShips = await inventoryWithLoadOutPresets.populate<{ Ships: IShipInventory }>(
|
||||
"Ships"
|
||||
);
|
||||
const inventoryResponse = inventoryWithLoadOutPresetsAndShips.toJSON<IInventoryResponse>();
|
||||
const inventoryResponse = inventoryWithLoadOutPresetsAndShips.toJSON<IInventoryClient>();
|
||||
|
||||
if (config.infiniteCredits) {
|
||||
inventoryResponse.RegularCredits = 999999999;
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { importInventory } from "@/src/services/importService";
|
||||
import { getInventory } from "@/src/services/inventoryService";
|
||||
import { getAccountIdForRequest } from "@/src/services/loginService";
|
||||
import { IInventoryResponse } from "@/src/types/inventoryTypes/inventoryTypes";
|
||||
import { IInventoryClient } from "@/src/types/inventoryTypes/inventoryTypes";
|
||||
import { RequestHandler } from "express";
|
||||
|
||||
export const importController: RequestHandler = async (req, res) => {
|
||||
@ -13,5 +13,5 @@ export const importController: RequestHandler = async (req, res) => {
|
||||
};
|
||||
|
||||
interface IImportRequest {
|
||||
inventory: IInventoryResponse;
|
||||
inventory: IInventoryClient;
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ import {
|
||||
IMiscItem,
|
||||
IInventoryDatabase,
|
||||
IBooster,
|
||||
IInventoryResponse,
|
||||
IInventoryClient,
|
||||
ISlots,
|
||||
IMailbox,
|
||||
IDuviriInfo,
|
||||
@ -1142,7 +1142,7 @@ inventorySchema.set("toJSON", {
|
||||
delete returnedObject.accountOwnerId;
|
||||
|
||||
const inventoryDatabase = returnedObject as IInventoryDatabase;
|
||||
const inventoryResponse = returnedObject as IInventoryResponse;
|
||||
const inventoryResponse = returnedObject as IInventoryClient;
|
||||
|
||||
inventoryResponse.TrainingDate = toMongoDate(inventoryDatabase.TrainingDate);
|
||||
inventoryResponse.Created = toMongoDate(inventoryDatabase.Created);
|
||||
|
@ -3,7 +3,7 @@
|
||||
import { Types } from "mongoose";
|
||||
import { IEquipmentClient, IEquipmentDatabase } from "../types/inventoryTypes/commonInventoryTypes";
|
||||
import { IMongoDate } from "../types/commonTypes";
|
||||
import { IInventoryResponse, IWeaponSkinClient, IWeaponSkinDatabase } from "../types/inventoryTypes/inventoryTypes";
|
||||
import { IInventoryClient, IWeaponSkinClient, IWeaponSkinDatabase } from "../types/inventoryTypes/inventoryTypes";
|
||||
import { TInventoryDatabaseDocument } from "../models/inventoryModels/inventoryModel";
|
||||
|
||||
const convertDate = (value: IMongoDate): Date => {
|
||||
@ -40,7 +40,7 @@ const replaceArray = <T>(arr: T[], replacement: T[]): void => {
|
||||
});
|
||||
};
|
||||
|
||||
export const importInventory = (db: TInventoryDatabaseDocument, client: IInventoryResponse): void => {
|
||||
export const importInventory = (db: TInventoryDatabaseDocument, client: IInventoryClient): void => {
|
||||
replaceArray<IEquipmentDatabase>(db.Suits, client.Suits.map(convertEquipment));
|
||||
replaceArray<IWeaponSkinDatabase>(db.WeaponSkins, client.WeaponSkins.map(convertWeaponSkin));
|
||||
};
|
||||
|
@ -13,7 +13,7 @@ import {
|
||||
|
||||
export interface IInventoryDatabase
|
||||
extends Omit<
|
||||
IInventoryResponse,
|
||||
IInventoryClient,
|
||||
| "TrainingDate"
|
||||
| "LoadOutPresets"
|
||||
| "Mailbox"
|
||||
@ -129,7 +129,7 @@ export interface IDailyAffiliations {
|
||||
DailyAffiliationHex: number;
|
||||
}
|
||||
|
||||
export interface IInventoryResponse extends IDailyAffiliations {
|
||||
export interface IInventoryClient extends IDailyAffiliations {
|
||||
Horses: IEquipmentDatabase[];
|
||||
DrifterMelee: IEquipmentDatabase[];
|
||||
DrifterGuns: IEquipmentDatabase[];
|
||||
|
Loading…
x
Reference in New Issue
Block a user