diff --git a/src/controllers/api/getShipController.ts b/src/controllers/api/getShipController.ts index 56485606..cc2794bf 100644 --- a/src/controllers/api/getShipController.ts +++ b/src/controllers/api/getShipController.ts @@ -2,6 +2,7 @@ import { RequestHandler } from "express"; import config from "@/config.json"; import allShipFeatures from "@/static/fixed_responses/allShipFeatures.json"; import { parseString } from "@/src/helpers/general"; +import { getPersonalRooms } from "@/src/services/personalRoomsService"; import { getShip } from "@/src/services/shipService"; import { PersonalRooms } from "@/src/models/personalRoomsModel"; import { Loadout } from "@/src/models/inventoryModels/loadoutModel"; @@ -48,13 +49,3 @@ export const getLoadout = async (accountId: string) => { return loadout; }; - -export const getPersonalRooms = async (accountId: string) => { - const personalRooms = await PersonalRooms.findOne({ personalRoomsOwnerId: accountId }); - - if (!personalRooms) { - logger.error(`personal rooms not found for account ${accountId}`); - throw new Error("personal rooms not found"); - } - return personalRooms; -}; diff --git a/src/controllers/api/setActiveShipController.ts b/src/controllers/api/setActiveShipController.ts index ed896b4e..2b7f7868 100644 --- a/src/controllers/api/setActiveShipController.ts +++ b/src/controllers/api/setActiveShipController.ts @@ -1,4 +1,4 @@ -import { getPersonalRooms } from "@/src/controllers/api/getShipController"; +import { getPersonalRooms } from "@/src/services/personalRoomsService"; import { parseString } from "@/src/helpers/general"; import { RequestHandler } from "express"; import { Types } from "mongoose";