fix bug
This commit is contained in:
parent
27ed19bd04
commit
96952d5ea6
@ -1,14 +1,13 @@
|
|||||||
|
import { RequestHandler } from "express";
|
||||||
|
|
||||||
import { Account } from "@/src/models/loginModel";
|
import { Account } from "@/src/models/loginModel";
|
||||||
import { Ship } from "@/src/models/shipModel";
|
import { Ship } from "@/src/models/shipModel";
|
||||||
|
|
||||||
import { createShip } from "@/src/services/shipService";
|
import { createShip } from "@/src/services/shipService";
|
||||||
|
|
||||||
import config from "@/config.json";
|
|
||||||
import testShipFeature from "@/static/fixed_responses/testShipFeature.json";
|
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
||||||
const getShipController: RequestHandler = async (_req, res) => {
|
const getShipController: RequestHandler = async (req, res) => {
|
||||||
const accountId = _req.query.accountId;
|
const accountId = req.query.accountId;
|
||||||
const ship = await Ship.findOne({ ShipOwnerId: accountId });
|
const ship = await Ship.findOne({ ShipOwnerId: accountId });
|
||||||
if (!ship) {
|
if (!ship) {
|
||||||
const account = await Account.findOne({ _id: accountId });
|
const account = await Account.findOne({ _id: accountId });
|
||||||
|
Loading…
x
Reference in New Issue
Block a user