feat: implement purchasing of skins #353
@ -14,7 +14,7 @@ import {
 | 
				
			|||||||
    ISeasonChallenge,
 | 
					    ISeasonChallenge,
 | 
				
			||||||
    ITypeCount,
 | 
					    ITypeCount,
 | 
				
			||||||
    InventorySlot,
 | 
					    InventorySlot,
 | 
				
			||||||
    IWeaponSkin
 | 
					    IWeaponSkinClient
 | 
				
			||||||
} from "@/src/types/inventoryTypes/inventoryTypes";
 | 
					} from "@/src/types/inventoryTypes/inventoryTypes";
 | 
				
			||||||
import { IGenericUpdate } from "../types/genericUpdate";
 | 
					import { IGenericUpdate } from "../types/genericUpdate";
 | 
				
			||||||
import {
 | 
					import {
 | 
				
			||||||
@ -458,7 +458,7 @@ export const addCustomization = async (customizatonName: string, accountId: stri
 | 
				
			|||||||
    return changedInventory.FlavourItems[flavourItemIndex].toJSON();
 | 
					    return changedInventory.FlavourItems[flavourItemIndex].toJSON();
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export const addSkin = async (typeName: string, accountId: string): Promise<IWeaponSkin> => {
 | 
					export const addSkin = async (typeName: string, accountId: string): Promise<IWeaponSkinClient> => {
 | 
				
			||||||
    const inventory = await getInventory(accountId);
 | 
					    const inventory = await getInventory(accountId);
 | 
				
			||||||
    const index = inventory.WeaponSkins.push({ ItemType: typeName }) - 1;
 | 
					    const index = inventory.WeaponSkins.push({ ItemType: typeName }) - 1;
 | 
				
			||||||
    const changedInventory = await inventory.save();
 | 
					    const changedInventory = await inventory.save();
 | 
				
			||||||
 | 
				
			|||||||
@ -138,7 +138,7 @@ export interface IInventoryResponse {
 | 
				
			|||||||
    LastRegionPlayed: string;
 | 
					    LastRegionPlayed: string;
 | 
				
			||||||
    XPInfo: ITypeXPItem[];
 | 
					    XPInfo: ITypeXPItem[];
 | 
				
			||||||
    Recipes: ITypeCount[];
 | 
					    Recipes: ITypeCount[];
 | 
				
			||||||
    WeaponSkins: IWeaponSkin[];
 | 
					    WeaponSkins: IWeaponSkinClient[];
 | 
				
			||||||
    PendingRecipes: IPendingRecipeResponse[];
 | 
					    PendingRecipes: IPendingRecipeResponse[];
 | 
				
			||||||
    TrainingDate: IMongoDate;
 | 
					    TrainingDate: IMongoDate;
 | 
				
			||||||
    PlayerLevel: number;
 | 
					    PlayerLevel: number;
 | 
				
			||||||
@ -852,7 +852,7 @@ export interface IWeaponSkinDatabase {
 | 
				
			|||||||
    ItemType: string;
 | 
					    ItemType: string;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export interface IWeaponSkin extends IWeaponSkinDatabase {
 | 
					export interface IWeaponSkinClient extends IWeaponSkinDatabase {
 | 
				
			||||||
    ItemId: IOid;
 | 
					    ItemId: IOid;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user