summaryrefslogtreecommitdiff
path: root/nodejs/lib
diff options
context:
space:
mode:
authorJulien Dessaux2023-10-20 00:17:31 +0200
committerJulien Dessaux2023-10-20 00:17:31 +0200
commit6cf84fe67f3a6232753a97afc8a41a07e759d1b0 (patch)
treecb54468eb200f51ab1baf9621d43969d9ba73d01 /nodejs/lib
parent[javascript] implemented contract fulfillment (diff)
downloadspacetraders-6cf84fe67f3a6232753a97afc8a41a07e759d1b0.tar.gz
spacetraders-6cf84fe67f3a6232753a97afc8a41a07e759d1b0.tar.bz2
spacetraders-6cf84fe67f3a6232753a97afc8a41a07e759d1b0.zip
[javascript] Track credits on contract fulfillment
Diffstat (limited to 'nodejs/lib')
-rw-r--r--nodejs/lib/contracts.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/nodejs/lib/contracts.js b/nodejs/lib/contracts.js
index a009889..9718f99 100644
--- a/nodejs/lib/contracts.js
+++ b/nodejs/lib/contracts.js
@@ -1,3 +1,4 @@
+import * as dbAgents from '../database/agents.js';
import * as dbContracts from '../database/contracts.js';
import * as api from './api.js';
import * as dbShips from '../database/ships.js';
@@ -62,5 +63,6 @@ export async function fulfill(ctx) {
api.debugLog(response);
throw response;
}
+ dbAgents.setAgent(response.data.agent);
dbContracts.setContract(response.data.contract);
}