From c9e7a341e78ef1a5ebcd19565820ac6e67a64b2f Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Sat, 16 Sep 2023 23:33:36 +0200 Subject: [javascript] fixed contract delivery --- nodejs/lib/contracts.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'nodejs/lib') diff --git a/nodejs/lib/contracts.js b/nodejs/lib/contracts.js index f73f297..5c2e970 100644 --- a/nodejs/lib/contracts.js +++ b/nodejs/lib/contracts.js @@ -20,6 +20,7 @@ export async function contracts() { } export async function deliver(ctx) { + await libShips.dock(ctx); const response = await api.send({ endpoint: `/my/contracts/${ctx.contract}/deliver`, method: 'POST', payload: { shipSymbol: ctx.symbol, tradeSymbol: ctx.good, @@ -29,6 +30,8 @@ export async function deliver(ctx) { throw response; } dbShips.setShipCargo(ctx.symbol, response.data.cargo); + // TODO update contract delivered units + // TODO track credits } export async function fulfill(ctx) { -- cgit v1.2.3