summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Dessaux2023-09-16 23:33:36 +0200
committerJulien Dessaux2023-09-16 23:33:36 +0200
commitc9e7a341e78ef1a5ebcd19565820ac6e67a64b2f (patch)
treeb55d71eba41923d9ef533b3b5fef90a5896ffe6d
parent[javascript] improved contract lib (diff)
downloadspacetraders-c9e7a341e78ef1a5ebcd19565820ac6e67a64b2f.tar.gz
spacetraders-c9e7a341e78ef1a5ebcd19565820ac6e67a64b2f.tar.bz2
spacetraders-c9e7a341e78ef1a5ebcd19565820ac6e67a64b2f.zip
[javascript] fixed contract delivery
Diffstat (limited to '')
-rw-r--r--nodejs/lib/contracts.js3
1 files changed, 3 insertions, 0 deletions
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) {