Skip to content

Commit

Permalink
CHE-190 linting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ekh88 committed Jul 6, 2024
1 parent b4bc014 commit 800ccc5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
12 changes: 5 additions & 7 deletions client/src/pages/RegistrationPage/RegistrationPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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.');
}

Expand Down Expand Up @@ -134,13 +132,13 @@ const RegistrationPage = () => {
)}
{registrationError === 'general' && (
<div className="mt-4 text-red-500 text-center">
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 [email protected] for assistance.
</div>
)}
{registrationError === 'passwords do not match' && (
<div className="mt-4 text-red-500 text-center">
Passwords do not match. Please try again.
Passwords do not match. Please try again.
</div>
)}
</form>
Expand Down
3 changes: 1 addition & 2 deletions server/controllers/userController.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand Down Expand Up @@ -162,4 +161,4 @@ const deleteUserByEmail = async (req: Request, res: Response, next: NextFunction
}
};

export { authUser, getUserById, deleteUserByEmail };
export { authUser, getUserById, deleteUserByEmail, registerUser };

0 comments on commit 800ccc5

Please sign in to comment.