feat: persist boot location (#159)
This commit is contained in:
parent
fd56203f35
commit
984c4ee43e
@ -1,6 +1,10 @@
|
|||||||
import { logger } from "@/src/utils/logger";
|
import { RequestHandler } from "express";
|
||||||
import { Request, Response } from "express";
|
import { getPersonalRooms } from "@/src/services/personalRoomsService";
|
||||||
|
import { TBootLocation } from "@/src/types/shipTypes";
|
||||||
|
|
||||||
export const setBootLocationController = (_req: Request, res: Response) => {
|
export const setBootLocationController: RequestHandler = async (req, res) => {
|
||||||
|
const personalRooms = await getPersonalRooms(req.query.accountId as string);
|
||||||
|
personalRooms.Ship.BootLocation = req.query.bootLocation as string as TBootLocation;
|
||||||
|
await personalRooms.save();
|
||||||
res.end();
|
res.end();
|
||||||
};
|
};
|
||||||
|
@ -46,7 +46,12 @@ const apartmentSchema = new Schema<IApartment>(
|
|||||||
);
|
);
|
||||||
|
|
||||||
const orbiterSchema = new Schema<IOrbiter>(
|
const orbiterSchema = new Schema<IOrbiter>(
|
||||||
{ Features: [String], Rooms: [roomSchema], ContentUrlSignature: String },
|
{
|
||||||
|
Features: [String],
|
||||||
|
Rooms: [roomSchema],
|
||||||
|
ContentUrlSignature: String,
|
||||||
|
BootLocation: String
|
||||||
|
},
|
||||||
{ _id: false }
|
{ _id: false }
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
import { IApartment, IRooms, IPlacedDecosDatabase } from "@/src/types/shipTypes";
|
import { IApartment, IRooms, IPlacedDecosDatabase, TBootLocation } from "@/src/types/shipTypes";
|
||||||
import { Model, Types } from "mongoose";
|
import { Model, Types } from "mongoose";
|
||||||
|
|
||||||
export interface IOrbiter {
|
export interface IOrbiter {
|
||||||
Features: string[];
|
Features: string[];
|
||||||
Rooms: IRooms[];
|
Rooms: IRooms[];
|
||||||
ContentUrlSignature: string;
|
ContentUrlSignature: string;
|
||||||
|
BootLocation?: TBootLocation;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IPersonalRooms {
|
export interface IPersonalRooms {
|
||||||
|
@ -19,13 +19,15 @@ export interface IShipInterior {
|
|||||||
SkinFlavourItem?: string;
|
SkinFlavourItem?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type TBootLocation = "LISET" | "DRIFTER_CAMP" | "APARTMENT";
|
||||||
|
|
||||||
export interface IShip {
|
export interface IShip {
|
||||||
Features: string[];
|
Features: string[];
|
||||||
ShipId: IOid;
|
ShipId: IOid;
|
||||||
ShipInterior: IShipInterior;
|
ShipInterior: IShipInterior;
|
||||||
Rooms: IRooms[];
|
Rooms: IRooms[];
|
||||||
ContentUrlSignature: string;
|
ContentUrlSignature: string;
|
||||||
BootLocation?: "LISET" | "DRIFTER_CAMP" | "APARTMENT";
|
BootLocation?: TBootLocation;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IShipDatabase {
|
export interface IShipDatabase {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user