forked from OpenWF/SpaceNinjaServer
fix ignoring static/data files, except .bin (#21)
This commit is contained in:
parent
d091af4778
commit
5838cddbdb
2
.gitignore
vendored
2
.gitignore
vendored
@ -2,5 +2,5 @@
|
||||
/build
|
||||
|
||||
/.env
|
||||
/static/data/*
|
||||
/static/data/*.bin
|
||||
yarn.lock
|
||||
|
@ -5,6 +5,7 @@ import { Types } from "mongoose";
|
||||
import { ISuitResponse } from "@/src/types/inventoryTypes/SuitTypes";
|
||||
import { SlotType } from "@/src/types/purchaseTypes";
|
||||
import { IWeaponResponse } from "@/src/types/inventoryTypes/weaponTypes";
|
||||
import { FlavourItem } from "@/src/types/inventoryTypes/inventoryTypes";
|
||||
|
||||
const createInventory = async (accountOwnerId: Types.ObjectId) => {
|
||||
try {
|
||||
@ -97,12 +98,12 @@ export const addWeapon = async (
|
||||
return changedInventory[weaponType][weaponIndex - 1].toJSON();
|
||||
};
|
||||
|
||||
export const addCustomization = async (customizatonName: string, accountId: string) => {
|
||||
export const addCustomization = async (customizatonName: string, accountId: string): Promise<FlavourItem> => {
|
||||
const inventory = await getInventory(accountId);
|
||||
|
||||
const flavourItemIndex = inventory.FlavourItems.push({ ItemType: customizatonName }) - 1;
|
||||
const changedInventory = await inventory.save();
|
||||
return changedInventory.FlavourItems[flavourItemIndex].toJSON();
|
||||
return changedInventory.FlavourItems[flavourItemIndex].toJSON(); //mongoose bug forces as FlavourItem
|
||||
};
|
||||
|
||||
export { createInventory, addPowerSuit };
|
||||
|
@ -1,7 +1,13 @@
|
||||
import { getWeaponType } from "@/src/helpers/purchaseHelpers";
|
||||
import { getSubstringFromKeyword } from "@/src/helpers/stringHelpers";
|
||||
import { addCustomization, addPowerSuit, addWeapon, updateSlots } from "@/src/services/inventoryService";
|
||||
import { IPurchaseRequest, SlotType } from "@/src/types/purchaseTypes";
|
||||
import {
|
||||
addCustomization,
|
||||
addPowerSuit,
|
||||
addWeapon,
|
||||
updateCurrency,
|
||||
updateSlots
|
||||
} from "@/src/services/inventoryService";
|
||||
import { IPurchaseRequest, IPurchaseResponse, SlotType } from "@/src/types/purchaseTypes";
|
||||
|
||||
export const getStoreItemCategory = (storeItem: string) => {
|
||||
const storeItemString = getSubstringFromKeyword(storeItem, "StoreItems/");
|
||||
|
@ -1,5 +1,6 @@
|
||||
/* eslint-disable prettier/prettier */
|
||||
import { ISuitDatabase } from "@/src/types/inventoryTypes/SuitTypes";
|
||||
import { FlavourItem } from "@/src/types/inventoryTypes/inventoryTypes";
|
||||
import { IWeaponResponse } from "@/src/types/inventoryTypes/weaponTypes";
|
||||
|
||||
export interface IPurchaseRequest {
|
||||
@ -28,6 +29,7 @@ export interface IPurchaseResponse {
|
||||
Melee?: IWeaponResponse[];
|
||||
PremiumCredits?: number;
|
||||
RegularCredits?: number;
|
||||
FlavourItems?: FlavourItem[];
|
||||
};
|
||||
}
|
||||
|
||||
|
18
static/data/items.ts
Normal file
18
static/data/items.ts
Normal file
@ -0,0 +1,18 @@
|
||||
import Items, { Item, Weapon } from "warframe-items";
|
||||
|
||||
type MinWeapon = Omit<Weapon, "patchlogs">;
|
||||
type MinItem = Omit<Item, "patchlogs">;
|
||||
|
||||
export const weapons: MinWeapon[] = (new Items({ category: ["Primary", "Secondary", "Melee"] }) as Weapon[]).map(
|
||||
item => {
|
||||
const next = { ...item };
|
||||
delete next.patchlogs;
|
||||
return next;
|
||||
}
|
||||
);
|
||||
|
||||
export const items: MinItem[] = new Items({ category: ["All"] }).map(item => {
|
||||
const next = { ...item };
|
||||
delete next.patchlogs;
|
||||
return next;
|
||||
});
|
Loading…
x
Reference in New Issue
Block a user