saveLoadout and misc. #99
@ -26,17 +26,23 @@ const EquipmentSelectionSchema = new Schema<IEquipmentSelection>(
 | 
			
		||||
    }
 | 
			
		||||
);
 | 
			
		||||
 | 
			
		||||
const loadoutConfigSchema = new Schema<ILoadoutConfigDatabase>({
 | 
			
		||||
    PresetIcon: String,
 | 
			
		||||
    Favorite: Boolean,
 | 
			
		||||
    s: EquipmentSelectionSchema,
 | 
			
		||||
    p: EquipmentSelectionSchema,
 | 
			
		||||
    l: EquipmentSelectionSchema,
 | 
			
		||||
    m: EquipmentSelectionSchema
 | 
			
		||||
});
 | 
			
		||||
const loadoutConfigSchema = new Schema<ILoadoutConfigDatabase>(
 | 
			
		||||
    {
 | 
			
		||||
        PresetIcon: String,
 | 
			
		||||
        Favorite: Boolean,
 | 
			
		||||
        n: String,
 | 
			
		||||
        s: EquipmentSelectionSchema,
 | 
			
		||||
        p: EquipmentSelectionSchema,
 | 
			
		||||
        l: EquipmentSelectionSchema,
 | 
			
		||||
        m: EquipmentSelectionSchema
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
        id: false
 | 
			
		||||
    }
 | 
			
		||||
);
 | 
			
		||||
 | 
			
		||||
loadoutConfigSchema.virtual("ItemId").get(function (): string {
 | 
			
		||||
    return this._id.toString();
 | 
			
		||||
loadoutConfigSchema.virtual("ItemId").get(function () {
 | 
			
		||||
    return { $oid: this._id.toString() } satisfies IOid;
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
loadoutConfigSchema.set("toJSON", {
 | 
			
		||||
 | 
			
		||||
@ -63,6 +63,7 @@ export interface ILoadoutKey {
 | 
			
		||||
// for request and response from and to client
 | 
			
		||||
export interface ILoadoutConfigClient {
 | 
			
		||||
    ItemId: IOid;
 | 
			
		||||
    n: string;
 | 
			
		||||
    PresetIcon: string;
 | 
			
		||||
    Favorite: boolean;
 | 
			
		||||
    s: IEquipmentSelection;
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user