feat : Admin can unlocked users
feat : admin can update and create users.
This commit is contained in:
@@ -38,10 +38,19 @@ async function getCustomerDetails(customerNo) {
|
||||
}
|
||||
|
||||
async function getCustomerDetailsFromDB(customerNo) {
|
||||
const result = await db.query('SELECT customer_no,created_at,last_login,is_first_login,ib_access_level,mb_access_level FROM users WHERE customer_no = $1', [
|
||||
const result = await db.query(
|
||||
'SELECT customer_no,created_at,last_login,is_first_login,ib_access_level,mb_access_level,inb_limit_amount,mobile_limit_amount,locked FROM users WHERE customer_no = $1 or preferred_name= $1', [
|
||||
customerNo,
|
||||
]);
|
||||
return result.rows[0];
|
||||
}
|
||||
|
||||
module.exports = { validateAdmin, findAdminByUserName, getCustomerDetails,getCustomerDetailsFromDB };
|
||||
async function updateUserLockStatus(customerNo ,locked ,adminUserName) {
|
||||
const result = await db.query(
|
||||
'Update users set locked =$2 ,unlocked_by=$3 WHERE customer_no = $1 or preferred_name= $1', [
|
||||
customerNo, locked ,adminUserName
|
||||
]);
|
||||
return result.rows[0];
|
||||
}
|
||||
|
||||
module.exports = { validateAdmin, findAdminByUserName, getCustomerDetails, getCustomerDetailsFromDB ,updateUserLockStatus };
|
||||
|
||||
Reference in New Issue
Block a user