linting done now fix unit tests
All checks were successful
Deploy to Test Environment / deploy-to-test (push) Successful in 8m19s

This commit is contained in:
2025-12-14 21:48:53 -08:00
parent 43ca7f9df2
commit 69e2287870
12 changed files with 106 additions and 57 deletions

View File

@@ -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');