From 800ccc51142916684ec3c6fcec371112323895ab Mon Sep 17 00:00:00 2001 From: Elsa <112454286+ekh88@users.noreply.github.com> Date: Sat, 6 Jul 2024 14:11:16 -0500 Subject: [PATCH] CHE-190 linting fixes --- .../src/pages/RegistrationPage/RegistrationPage.tsx | 12 +++++------- server/controllers/userController.ts | 3 +-- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/client/src/pages/RegistrationPage/RegistrationPage.tsx b/client/src/pages/RegistrationPage/RegistrationPage.tsx index 9432429..034a095 100644 --- a/client/src/pages/RegistrationPage/RegistrationPage.tsx +++ b/client/src/pages/RegistrationPage/RegistrationPage.tsx @@ -33,13 +33,11 @@ const RegistrationPage = () => { console.error('Token is missing.'); setRegistrationError('token'); // return; //TODO Display error feedback for user - } - ; //TODO User feedback needed if (formData.password !== formData.password2) { - setRegistrationError('passwords do not match') - }; + setRegistrationError('passwords do not match'); + } try { const response = await fetch(`/api/users/register?token=${token}`, { method: 'POST', @@ -50,7 +48,7 @@ const RegistrationPage = () => { }); const data = await response.json(); if (!response.ok) { - setRegistrationError('general') + setRegistrationError('general'); throw new Error(data.message || 'An error occurred during registration.'); } @@ -134,13 +132,13 @@ const RegistrationPage = () => { )} {registrationError === 'general' && (
- Sorry! It's not you - it's us. We are unable to register you at this time. Please + Sorry! It is not you - it is us. We are unable to register you at this time. Please e-mail brok3turtl3@gmail.com for assistance.
)} {registrationError === 'passwords do not match' && (
- Passwords do not match. Please try again. + Passwords do not match. Please try again.
)} diff --git a/server/controllers/userController.ts b/server/controllers/userController.ts index 713ea43..5a9f809 100644 --- a/server/controllers/userController.ts +++ b/server/controllers/userController.ts @@ -1,5 +1,4 @@ import User from '../models/userModel'; -import generateToken from '../utils/generateToken'; import { Request, Response, NextFunction } from 'express'; import { UserType } from '../types/user'; @@ -162,4 +161,4 @@ const deleteUserByEmail = async (req: Request, res: Response, next: NextFunction } }; -export { authUser, getUserById, deleteUserByEmail }; +export { authUser, getUserById, deleteUserByEmail, registerUser };