implemented integrations and events system
This commit is contained in:
@@ -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> {
|
||||
|
||||
Reference in New Issue
Block a user