Allow updating production plan responsibility
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 2m13s
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 2m13s
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
const crypto = require('crypto');
|
||||
const { pool } = require('../db');
|
||||
|
||||
const SYSTEM_OPERATIONAL_USER_NAME = 'Super Admin';
|
||||
|
||||
const HASH_ALGORITHM = 'scrypt';
|
||||
const KEY_LENGTH = 64;
|
||||
|
||||
@@ -70,10 +72,14 @@ const listActiveOperationalUsers = async () => {
|
||||
ORDER BY LOWER(name), id`
|
||||
);
|
||||
|
||||
return result.rows.map((row) => ({
|
||||
id: Number(row.id),
|
||||
name: row.name
|
||||
}));
|
||||
return [
|
||||
{ id: null, name: SYSTEM_OPERATIONAL_USER_NAME, isSystem: true },
|
||||
...result.rows.map((row) => ({
|
||||
id: Number(row.id),
|
||||
name: row.name,
|
||||
isSystem: false
|
||||
}))
|
||||
];
|
||||
};
|
||||
|
||||
const getActiveOperationalUserById = async (id, client = pool) => {
|
||||
@@ -234,6 +240,7 @@ module.exports = {
|
||||
listUsers,
|
||||
normalizeEmail,
|
||||
publicUserFields,
|
||||
SYSTEM_OPERATIONAL_USER_NAME,
|
||||
updateUser,
|
||||
verifyPassword
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user