Skip to content

Commit

Permalink
Fix eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
giorgio-tran committed Nov 9, 2023
1 parent 3ce55ee commit be288d6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 16 deletions.
28 changes: 14 additions & 14 deletions my-app/src/pages/register/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,16 @@ const Register = () => {
}
if (data.password !== data.confirmPassword) {
setError(true);
setPasswordErr(true);
setPasswordErr(true);
setErrMsg("The Passwords Do Not Match!")
return;
}
if(!regularExpression.test(data.password)) {
if(!regularExpression.test(data.password)) {
setError(true);
setPasswordErr(true);
setErrMsg("The Password Is Not Strong Enough! Password must contain at least one number, one uppercase letter, nd one lowercase letter. ")
return;
}
}

const res = await fetch(`/api/mongo/user/find-user/${data.email}`);
const user = await res.json();
Expand Down Expand Up @@ -208,12 +208,12 @@ const Register = () => {
</span>
</div>
<div
className={`mt-2 py-1.5 px-2 rounded text-sm bg-red-100 text-red-600 border border-red-500 ${
emailErr ?{error} : "hidden"
}`}
>
className={`mt-2 py-1.5 px-2 rounded text-sm bg-red-100 text-red-600 border border-red-500 ${
emailErr ?{error} : "hidden"
}`}
>
The Input Email Addresses Do Not Match!
</div>
</div>
</div>

<div>
Expand Down Expand Up @@ -264,12 +264,12 @@ const Register = () => {
/>
</div>
<div
className={`mt-2 py-1.5 px-2 rounded text-sm bg-red-100 text-red-600 border border-red-500 ${
passwordErr ?{error} : "hidden"
}`}
>
{errMsg}
</div>
className={`mt-2 py-1.5 px-2 rounded text-sm bg-red-100 text-red-600 border border-red-500 ${
passwordErr ?{error} : "hidden"
}`}
>
{errMsg}
</div>
</div>

<div>
Expand Down
2 changes: 1 addition & 1 deletion my-app/src/pages/thread/[_id].jsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const ThreadPage = () => {
<ThreadInfo thread={thread}></ThreadInfo>
<h1 className=" text-xl font-semibold text-gray-800 mb-2">Messages</h1>
{thread.messages.length ? (
thread.messages.map((message) => <Chat message={message}></Chat>)
thread.messages.map((message, index) => <Chat key={index} message={message}></Chat>)
) : (
<div>There are currently no messages</div>
)}
Expand Down
1 change: 0 additions & 1 deletion my-app/src/pages/threads/index.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { useEffect, useState } from "react";
import Thread from "@/components/Thread";
import { set } from "mongoose";
import Loading from "@/components/Loading";

// TODO: implement page for each thread
Expand Down

0 comments on commit be288d6

Please sign in to comment.