fix: save tailorshop customisations
All checks were successful
Build / build (20) (push) Successful in 35s
Build / build (18) (push) Successful in 53s
Build / build (22) (push) Successful in 1m4s
Build / build (18) (pull_request) Successful in 38s
Build / build (20) (pull_request) Successful in 53s
Build / build (22) (pull_request) Successful in 1m6s
All checks were successful
Build / build (20) (push) Successful in 35s
Build / build (18) (push) Successful in 53s
Build / build (22) (push) Successful in 1m4s
Build / build (18) (pull_request) Successful in 38s
Build / build (20) (pull_request) Successful in 53s
Build / build (22) (pull_request) Successful in 1m6s
This commit is contained in:
parent
eb3acad598
commit
92012baac0
@ -125,6 +125,7 @@ favouriteLoadoutSchema.set("toJSON", {
|
||||
const tailorShopSchema = new Schema<ITailorShopDatabase>(
|
||||
{
|
||||
FavouriteLoadouts: [favouriteLoadoutSchema],
|
||||
Colors: { type: colorSchema, required: false },
|
||||
CustomJson: String,
|
||||
LevelDecosVisible: Boolean,
|
||||
Rooms: [roomSchema]
|
||||
|
@ -28,7 +28,13 @@ export const setShipCustomizations = async (
|
||||
}
|
||||
} else {
|
||||
const personalRooms = await getPersonalRooms(accountId);
|
||||
personalRooms.ShipInteriorColors = shipCustomization.Customization.Colors;
|
||||
if (shipCustomization.IsShop) {
|
||||
personalRooms.TailorShop.Colors = shipCustomization.Customization.Colors;
|
||||
personalRooms.TailorShop.LevelDecosVisible = shipCustomization.Customization.LevelDecosVisible;
|
||||
personalRooms.TailorShop.CustomJson = shipCustomization.Customization.CustomJson;
|
||||
} else {
|
||||
personalRooms.ShipInteriorColors = shipCustomization.Customization.Colors;
|
||||
}
|
||||
await personalRooms.save();
|
||||
}
|
||||
};
|
||||
|
@ -84,12 +84,15 @@ export interface ISetShipCustomizationsRequest {
|
||||
Customization: Customization;
|
||||
IsExterior: boolean;
|
||||
AirSupportPower?: string;
|
||||
IsShop?: boolean;
|
||||
}
|
||||
|
||||
export interface Customization {
|
||||
SkinFlavourItem: string;
|
||||
Colors: IColor;
|
||||
ShipAttachments: ShipAttachments;
|
||||
LevelDecosVisible: boolean;
|
||||
CustomJson: string;
|
||||
}
|
||||
|
||||
//TODO: check for more attachments
|
||||
@ -155,12 +158,12 @@ export interface IFavouriteLoadoutDatabase {
|
||||
|
||||
export interface ITailorShopDatabase {
|
||||
FavouriteLoadouts: IFavouriteLoadoutDatabase[];
|
||||
CustomJson: "{}"; // ???
|
||||
Colors?: IColor;
|
||||
CustomJson: string;
|
||||
LevelDecosVisible: boolean;
|
||||
Rooms: IRoom[];
|
||||
}
|
||||
|
||||
export interface ITailorShop extends Omit<ITailorShopDatabase, "FavouriteLoadouts"> {
|
||||
FavouriteLoadouts: IFavouriteLoadout[];
|
||||
Colors?: []; // ???
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user