loadouts workinhg

This commit is contained in:
Ordis 2023-12-03 01:58:06 +01:00
parent f271898ced
commit 36e76a9a84
2 changed files with 17 additions and 10 deletions

View File

@ -26,17 +26,23 @@ const EquipmentSelectionSchema = new Schema<IEquipmentSelection>(
} }
); );
const loadoutConfigSchema = new Schema<ILoadoutConfigDatabase>({ const loadoutConfigSchema = new Schema<ILoadoutConfigDatabase>(
PresetIcon: String, {
Favorite: Boolean, PresetIcon: String,
s: EquipmentSelectionSchema, Favorite: Boolean,
p: EquipmentSelectionSchema, n: String,
l: EquipmentSelectionSchema, s: EquipmentSelectionSchema,
m: EquipmentSelectionSchema p: EquipmentSelectionSchema,
}); l: EquipmentSelectionSchema,
m: EquipmentSelectionSchema
},
{
id: false
}
);
loadoutConfigSchema.virtual("ItemId").get(function (): string { loadoutConfigSchema.virtual("ItemId").get(function () {
return this._id.toString(); return { $oid: this._id.toString() } satisfies IOid;
}); });
loadoutConfigSchema.set("toJSON", { loadoutConfigSchema.set("toJSON", {

View File

@ -63,6 +63,7 @@ export interface ILoadoutKey {
// for request and response from and to client // for request and response from and to client
export interface ILoadoutConfigClient { export interface ILoadoutConfigClient {
ItemId: IOid; ItemId: IOid;
n: string;
PresetIcon: string; PresetIcon: string;
Favorite: boolean; Favorite: boolean;
s: IEquipmentSelection; s: IEquipmentSelection;