From 9c5310e418e1dd626d5cb8aed752180eed7fec00 Mon Sep 17 00:00:00 2001 From: Sainan Date: Mon, 20 Jan 2025 08:07:40 +0100 Subject: [PATCH] remove duplicate getLoadout --- src/controllers/api/getShipController.ts | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/controllers/api/getShipController.ts b/src/controllers/api/getShipController.ts index 3ce7a6c3..10f6e25f 100644 --- a/src/controllers/api/getShipController.ts +++ b/src/controllers/api/getShipController.ts @@ -4,10 +4,10 @@ import allShipFeatures from "@/static/fixed_responses/allShipFeatures.json"; import { getAccountIdForRequest } from "@/src/services/loginService"; import { getPersonalRooms } from "@/src/services/personalRoomsService"; import { getShip } from "@/src/services/shipService"; -import { Loadout } from "@/src/models/inventoryModels/loadoutModel"; import { toOid } from "@/src/helpers/inventoryHelpers"; import { IGetShipResponse } from "@/src/types/shipTypes"; import { IPersonalRooms } from "@/src/types/personalRoomsTypes"; +import { getLoadout } from "@/src/services/loadoutService"; export const getShipController: RequestHandler = async (req, res) => { const accountId = await getAccountIdForRequest(req); @@ -38,13 +38,3 @@ export const getShipController: RequestHandler = async (req, res) => { res.json(getShipResponse); }; - -export const getLoadout = async (accountId: string) => { - const loadout = await Loadout.findOne({ loadoutOwnerId: accountId }); - - if (!loadout) { - throw new Error(`loadout not found for account ${accountId}`); - } - - return loadout; -};