Implemented admin assign unit UI
All checks were successful
Pull Request CI / Merge Check (pull_request) Successful in 3m55s

This commit is contained in:
2026-03-02 20:16:28 -05:00
parent 54dcb9d389
commit a988545dda
7 changed files with 278 additions and 5 deletions

View File

@@ -10,4 +10,13 @@ export async function cancelLatestUnit(userID: number, con: mariadb.Pool | maria
} catch (error) {
throw error;
}
}
export async function assignNewUnit(memberID: number, unitID: number, authorizedID: number, creatorID: number, reason: string) {
let sql = `CALL sp_update_member_unit(?, ?, ?, ?, ?, NOW())`;
const result = await pool.query(sql, [memberID, unitID, authorizedID, creatorID, reason]);
if (!result || result.affectedRows === 0) {
throw new Error('Record was not updated');
}
}