linting done now fix unit tests
All checks were successful
Deploy to Test Environment / deploy-to-test (push) Successful in 8m19s
All checks were successful
Deploy to Test Environment / deploy-to-test (push) Successful in 8m19s
This commit is contained in:
@@ -172,12 +172,15 @@ export class UserRepository {
|
||||
* @returns A promise that resolves to the user object (id, email, password_hash) or undefined if not found.
|
||||
*/
|
||||
// prettier-ignore
|
||||
async findUserWithPasswordHashById(userId: string, logger: Logger): Promise<{ user_id: string; email: string; password_hash: string | null } | undefined> {
|
||||
async findUserWithPasswordHashById(userId: string, logger: Logger): Promise<{ user_id: string; email: string; password_hash: string | null }> {
|
||||
try {
|
||||
const res = await this.db.query<{ user_id: string; email: string; password_hash: string | null }>(
|
||||
'SELECT user_id, email, password_hash FROM public.users WHERE user_id = $1',
|
||||
[userId]
|
||||
);
|
||||
if (res.rowCount === 0) {
|
||||
throw new NotFoundError(`User with ID ${userId} not found.`);
|
||||
}
|
||||
return res.rows[0];
|
||||
} catch (error) {
|
||||
logger.error({ err: error, userId }, 'Database error in findUserWithPasswordHashById');
|
||||
|
||||
Reference in New Issue
Block a user