[node] finished the great typescript rewrite
This commit is contained in:
parent
8107afbd90
commit
a1d6b03ec9
30 changed files with 1019 additions and 359 deletions
9
nodejs/automation/exploration.ts
Normal file
9
nodejs/automation/exploration.ts
Normal file
|
@ -0,0 +1,9 @@
|
|||
import db from '../database/db.ts';
|
||||
import * as dbSystems from '../database/systems.ts';
|
||||
import { System } from '../model/system.ts';
|
||||
import * as api from '../lib/api.ts';
|
||||
|
||||
export async function init(): Promise<void> {
|
||||
const response = await api.sendPaginated<System>({endpoint: `/systems`, page: Math.max(1, Math.floor(dbSystems.getSystemsCount()/20)), priority: 100});
|
||||
db.transaction(() => response.forEach(function(system) { try { dbSystems.addSystem(system); } catch {} }))();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue