Implemented admin assign unit UI
All checks were successful
Pull Request CI / Merge Check (pull_request) Successful in 3m55s
All checks were successful
Pull Request CI / Merge Check (pull_request) Successful in 3m55s
This commit is contained in:
@@ -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');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user