implemented integrations and events system

This commit is contained in:
2026-01-01 16:04:04 -05:00
parent d962b88d73
commit 318762e1b4
7 changed files with 120 additions and 24 deletions

View File

@@ -2,10 +2,19 @@ import { ApplicationListRow, ApplicationRow, CommentRow } from "@app/shared/type
import pool from "../../db";
import { error } from "console";
export async function createApplication(memberID: number, appVersion: number, app: string) {
/**
* Create an application in the db
* @param memberID
* @param appVersion
* @param app
* @returns ID of the created application
*/
export async function createApplication(memberID: number, appVersion: number, app: string): Promise<number> {
const sql = `INSERT INTO applications (member_id, app_version, app_data) VALUES (?, ?, ?);`;
const params = [memberID, appVersion, JSON.stringify(app)]
return await pool.query(sql, params);
let result = await pool.query(sql, params);
return Number(result.insertId);
}
export async function getMemberApplication(memberID: number): Promise<ApplicationRow> {