From de0251bc22d554e2ace4d2d3d061dc1054656bcd Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Mon, 13 May 2024 23:45:45 +0200 Subject: [node] Big Contracts lib refactoring --- nodejs/lib/ships.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'nodejs/lib/ships.ts') diff --git a/nodejs/lib/ships.ts b/nodejs/lib/ships.ts index 74419fc..8df3aea 100644 --- a/nodejs/lib/ships.ts +++ b/nodejs/lib/ships.ts @@ -10,11 +10,11 @@ import { ShipIsStillOnCooldownError, ShipRequiresMoreFuelForNavigationError, } from './errors.ts'; +import { Contract } from './contracts.ts'; import * as libSystems from './systems.ts'; import { Agent, Cargo, - Contract, Cooldown, Fuel, Nav, @@ -25,7 +25,6 @@ import { shortestPath, } from './utils.ts'; import * as dbAgents from '../database/agents.ts'; -import * as dbContracts from '../database/contracts.ts'; export async function getShips(): Promise> { const response = await send>({endpoint: `/my/ships`, page: 1}); @@ -154,8 +153,7 @@ export class Ship { throw response; } } - dbContracts.setContract(response.data.contract); - return response.data.contract; + return new Contract(response.data.contract); } async orbit(): Promise { if (this.nav.status === 'IN_ORBIT') return; -- cgit v1.2.3