More bookstack integration stuff
This commit is contained in:
@@ -27,4 +27,26 @@ export async function createNewLOA(data: LOARequest) {
|
||||
VALUES (?, ?, ?, ?, ?, ?)`;
|
||||
await pool.query(sql, [data.member_id, toDateTime(data.filed_date), toDateTime(data.start_date), toDateTime(data.end_date), data.type_id, data.reason])
|
||||
return;
|
||||
}
|
||||
|
||||
export async function closeLOA(id: number, closer: number) {
|
||||
const sql = `UPDATE leave_of_absences
|
||||
SET closed = 1,
|
||||
closed_by = ?
|
||||
WHERE leave_of_absences.id = ?`;
|
||||
let out = await pool.query(sql, [closer, id]);
|
||||
console.log(out);
|
||||
return out;
|
||||
}
|
||||
|
||||
export async function getLOAbyID(id: number): Promise<LOARequest> {
|
||||
let res = await pool.query(`SELECT * FROM leave_of_absences WHERE id = ?`, [id]);
|
||||
if (res.length != 1)
|
||||
throw new Error(`LOA with id ${id} not found`);
|
||||
return res[0];
|
||||
}
|
||||
|
||||
export async function setLOAExtension(id: number, extendTo: Date) {
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user