From bd837381689cc6e87b30053c9bb2727b8d9672b3 Mon Sep 17 00:00:00 2001 From: Sainan <63328889+Sainan@users.noreply.github.com> Date: Tue, 15 Apr 2025 06:15:49 -0700 Subject: [PATCH] fix: provide a response to setPlacedDecoInfo (#1632) This seems to be needed for the client when refreshing the ship after loading into a mission as it does not resync the ship otherwise. Closes #1629 Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/1632 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com> --- .../api/setPlacedDecoInfoController.ts | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/controllers/api/setPlacedDecoInfoController.ts b/src/controllers/api/setPlacedDecoInfoController.ts index 56b9afe7..19f76061 100644 --- a/src/controllers/api/setPlacedDecoInfoController.ts +++ b/src/controllers/api/setPlacedDecoInfoController.ts @@ -1,5 +1,5 @@ import { getAccountIdForRequest } from "@/src/services/loginService"; -import { ISetPlacedDecoInfoRequest } from "@/src/types/shipTypes"; +import { IPictureFrameInfo, ISetPlacedDecoInfoRequest } from "@/src/types/shipTypes"; import { RequestHandler } from "express"; import { handleSetPlacedDecoInfo } from "@/src/services/shipCustomizationsService"; @@ -7,5 +7,17 @@ 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); - res.end(); + res.json({ + DecoId: payload.DecoId, + IsPicture: true, + PictureFrameInfo: payload.PictureFrameInfo, + BootLocation: payload.BootLocation + } satisfies ISetPlacedDecoInfoResponse); }; + +interface ISetPlacedDecoInfoResponse { + DecoId: string; + IsPicture: boolean; + PictureFrameInfo?: IPictureFrameInfo; + BootLocation?: string; +}