[javascript] added contracts and agent database management
This commit is contained in:
parent
9a71163dda
commit
e03bb90611
4 changed files with 53 additions and 1 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue