2024-05-06 15:39:27 +02:00
|
|
|
import { RequestHandler } from "express";
|
2024-05-28 13:45:06 +02:00
|
|
|
import { getAccountIdForRequest } from "@/src/services/loginService";
|
2024-05-06 15:39:27 +02:00
|
|
|
import { getPersonalRooms } from "@/src/services/personalRoomsService";
|
|
|
|
import { TBootLocation } from "@/src/types/shipTypes";
|
2023-12-14 17:34:15 +01:00
|
|
|
|
2024-05-06 15:39:27 +02:00
|
|
|
export const setBootLocationController: RequestHandler = async (req, res) => {
|
2024-05-28 13:45:06 +02:00
|
|
|
const accountId = await getAccountIdForRequest(req);
|
|
|
|
const personalRooms = await getPersonalRooms(accountId);
|
2024-05-06 15:39:27 +02:00
|
|
|
personalRooms.Ship.BootLocation = req.query.bootLocation as string as TBootLocation;
|
|
|
|
await personalRooms.save();
|
2023-12-14 17:34:15 +01:00
|
|
|
res.end();
|
|
|
|
};
|