summaryrefslogtreecommitdiff
path: root/lib/contracts.js
diff options
context:
space:
mode:
authorJulien Dessaux2023-05-29 23:25:09 +0200
committerJulien Dessaux2023-05-29 23:25:09 +0200
commitd79a4485a6b1a3ae6b647d94b45ee22a515441f2 (patch)
treeeccef4acf2a206fa0cfd74c783672287ae99a50b /lib/contracts.js
parentRefactored the code to separate automation code from the lib handling the api (diff)
downloadspacetraders-d79a4485a6b1a3ae6b647d94b45ee22a515441f2.tar.gz
spacetraders-d79a4485a6b1a3ae6b647d94b45ee22a515441f2.tar.bz2
spacetraders-d79a4485a6b1a3ae6b647d94b45ee22a515441f2.zip
Many new api calls
Diffstat (limited to '')
-rw-r--r--lib/contracts.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/contracts.js b/lib/contracts.js
index 9494595..a118ae4 100644
--- a/lib/contracts.js
+++ b/lib/contracts.js
@@ -1,7 +1,7 @@
import * as api from './api.js';
export async function accept(ctx) {
- return await api.send({endpoint: `/my/contracts/${ctx.id}/accept`, method: 'POST'});
+ return await api.send({endpoint: `/my/contracts/${ctx.contract}/accept`, method: 'POST'});
}
export async function contracts() {
@@ -15,3 +15,7 @@ export async function deliver(ctx) {
units: ctx.units,
}});
}
+
+export async function fulfill(ctx) {
+ return await api.send({ endpoint: `/my/contracts/${ctx.contract}/fulfill`, method: 'POST'});
+}