addition of new dashboard
This commit is contained in:
24
backend/apps.js
Normal file
24
backend/apps.js
Normal file
@@ -0,0 +1,24 @@
|
||||
import { getConfig } from "./common/config.js";
|
||||
import { watchAudits } from "./common/queue.js";
|
||||
import { getPool } from "./db/index.js";
|
||||
|
||||
export async function loadApps() {
|
||||
const config = getConfig();
|
||||
const client = await getPool();
|
||||
for (const type in config.appModules) {
|
||||
// Internal modules (e.g. dashboard) have no `app` row / API surface.
|
||||
if (config.appModules[type]?.internal) continue;
|
||||
await client.query(`
|
||||
INSERT INTO public.app (
|
||||
type
|
||||
) VALUES (
|
||||
$1
|
||||
) ON CONFLICT DO NOTHING;
|
||||
`, [
|
||||
type,
|
||||
]);
|
||||
if (type === 'core')
|
||||
watchAudits();
|
||||
}
|
||||
await client.release();
|
||||
}
|
||||
Reference in New Issue
Block a user