返回提交历史
Modified
src/controllers/api/getShipController.ts
+2
-4
XFEstudio/SpaceNinjaServer
chore: remove query for ship in getShipController (#2022)
as far as I can tell, the ShipAttachments and SkinFlavourItem are just here due to the fact that the type from ShipExterior is being reused, but they aren't actually needed because the interior can't have attachments or flavour items - and if it could, they would be different from the exterior anyway. Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/2022 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
8d788d38
代码差异
1 个文件
+2
-4
@@ -3,7 +3,6 @@ import { config } from "@/src/services/configService";
3
3
import allShipFeatures from "@/static/fixed_responses/allShipFeatures.json";
4
4
import { getAccountIdForRequest } from "@/src/services/loginService";
5
5
import { createGarden, getPersonalRooms } from "@/src/services/personalRoomsService";
6
import { getShip } from "@/src/services/shipService";
7
6
import { toOid } from "@/src/helpers/inventoryHelpers";
8
7
import { IGetShipResponse } from "@/src/types/shipTypes";
9
8
import { IPersonalRoomsClient } from "@/src/types/personalRoomsTypes";
@@ -21,7 +20,6 @@ export const getShipController: RequestHandler = async (req, res) => {
21
20
22
21
const personalRooms = personalRoomsDb.toJSON<IPersonalRoomsClient>();
23
22
const loadout = await getLoadout(accountId);
24
const ship = await getShip(personalRoomsDb.activeShipId, "ShipAttachments SkinFlavourItem");
25
23
26
24
const getShipResponse: IGetShipResponse = {
27
25
ShipOwnerId: accountId,
@@ -31,8 +29,8 @@ export const getShipController: RequestHandler = async (req, res) => {
31
29
ShipId: toOid(personalRoomsDb.activeShipId),
32
30
ShipInterior: {
33
31
Colors: personalRooms.ShipInteriorColors,
34
ShipAttachments: ship.ShipAttachments,
35
SkinFlavourItem: ship.SkinFlavourItem
32
ShipAttachments: { HOOD_ORNAMENT: "" },
33
SkinFlavourItem: ""
36
34
},
37
35
FavouriteLoadoutId: personalRooms.Ship.FavouriteLoadoutId
38
36
? toOid(personalRooms.Ship.FavouriteLoadoutId)