2024-10-18 16:54:49 +02:00
|
|
|
import { getAccountIdForRequest } from "@/src/services/loginService";
|
2025-04-15 06:15:49 -07:00
|
|
|
import { IPictureFrameInfo, ISetPlacedDecoInfoRequest } from "@/src/types/shipTypes";
|
2024-10-18 16:54:49 +02:00
|
|
|
import { RequestHandler } from "express";
|
|
|
|
import { handleSetPlacedDecoInfo } from "@/src/services/shipCustomizationsService";
|
|
|
|
|
|
|
|
export const setPlacedDecoInfoController: RequestHandler = async (req, res) => {
|
|
|
|
const accountId = await getAccountIdForRequest(req);
|
|
|
|
const payload = JSON.parse(req.body as string) as ISetPlacedDecoInfoRequest;
|
|
|
|
await handleSetPlacedDecoInfo(accountId, payload);
|
2025-04-15 06:15:49 -07:00
|
|
|
res.json({
|
|
|
|
DecoId: payload.DecoId,
|
|
|
|
IsPicture: true,
|
|
|
|
PictureFrameInfo: payload.PictureFrameInfo,
|
|
|
|
BootLocation: payload.BootLocation
|
|
|
|
} satisfies ISetPlacedDecoInfoResponse);
|
2024-10-18 16:54:49 +02:00
|
|
|
};
|
2025-04-15 06:15:49 -07:00
|
|
|
|
|
|
|
interface ISetPlacedDecoInfoResponse {
|
|
|
|
DecoId: string;
|
|
|
|
IsPicture: boolean;
|
|
|
|
PictureFrameInfo?: IPictureFrameInfo;
|
|
|
|
BootLocation?: string;
|
|
|
|
}
|