diff options
author | Julien Dessaux | 2023-05-29 23:25:09 +0200 |
---|---|---|
committer | Julien Dessaux | 2023-05-29 23:25:09 +0200 |
commit | d79a4485a6b1a3ae6b647d94b45ee22a515441f2 (patch) | |
tree | eccef4acf2a206fa0cfd74c783672287ae99a50b /lib/contracts.js | |
parent | Refactored the code to separate automation code from the lib handling the api (diff) | |
download | spacetraders-d79a4485a6b1a3ae6b647d94b45ee22a515441f2.tar.gz spacetraders-d79a4485a6b1a3ae6b647d94b45ee22a515441f2.tar.bz2 spacetraders-d79a4485a6b1a3ae6b647d94b45ee22a515441f2.zip |
Many new api calls
Diffstat (limited to 'lib/contracts.js')
-rw-r--r-- | lib/contracts.js | 6 |
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'}); +} |