1
0
Fork 0

[javascript] fixed contract delivery

This commit is contained in:
Julien Dessaux 2023-09-16 23:33:36 +02:00
parent 4c1a5fdfe1
commit c9e7a341e7
Signed by: adyxax
GPG key ID: F92E51B86E07177E

View file

@ -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) {