summaryrefslogtreecommitdiff
path: root/nodejs/lib
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--nodejs/lib/contracts.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/nodejs/lib/contracts.js b/nodejs/lib/contracts.js
index 316e181..e4ba2ae 100644
--- a/nodejs/lib/contracts.js
+++ b/nodejs/lib/contracts.js
@@ -1,3 +1,4 @@
+import * as dbContracts from '../database/contracts.js';
import * as api from './api.js';
import * as dbShips from '../database/ships.js';
@@ -6,7 +7,9 @@ export async function accept(ctx) {
}
export async function contracts() {
- return await api.send({endpoint: '/my/contracts'});
+ const contracts = await api.send({endpoint: '/my/contracts', page: 1});
+ contracts.forEach(contract => dbContracts.setContract(contract));
+ return contracts;
}
export async function deliver(ctx) {