1
0
Fork 0

[node] finished the great typescript rewrite

This commit is contained in:
Julien Dessaux 2024-03-27 15:20:14 +01:00
parent 8107afbd90
commit a1d6b03ec9
Signed by: adyxax
GPG key ID: F92E51B86E07177E
30 changed files with 1019 additions and 359 deletions

View 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 {} }))();
}