Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Daniel tech submission #11

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/src/controllers/project.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ router.get("/list", passport.authenticate("user", { session: false }), async (re

router.get("/:id", passport.authenticate("user", { session: false }), async (req, res) => {
try {
const data = await ProjectObject.find({ _id: req.params.id });
const data = await ProjectObject.findOne({ _id: req.params.id });
return res.status(200).send({ ok: true, data });
} catch (error) {
console.log(error);
Expand Down
8 changes: 6 additions & 2 deletions app/src/scenes/auth/signup.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import toast from "react-hot-toast";
import { useDispatch, useSelector } from "react-redux";
import { Link, Redirect } from "react-router-dom";
import validator from "validator";
import { IoIosArrowBack } from "react-icons/io";

import { setUser } from "../../redux/auth/actions";

Expand All @@ -17,8 +18,11 @@ export default () => {
return (
// Auth Wrapper
<div className="authWrapper font-myfont">
<Link to="/auth/login" className="flex gap-1 items-center">
<IoIosArrowBack />
<span>Go back</span>
</Link>
<div className="font-[Helvetica] text-center text-[32px] font-semibold mb-[15px]">Account team</div>

{user && <Redirect to="/" />}
<Formik
initialValues={{ username: "", organisation: "", password: "" }}
Expand All @@ -29,7 +33,7 @@ export default () => {
if (user) dispatch(setUser(user));
} catch (e) {
console.log("e", e);
toast.error("Wrong login", e.code);
toast.error("Error with signup", e.code);
}
actions.setSubmitting(false);
}}>
Expand Down
10 changes: 8 additions & 2 deletions app/src/scenes/user/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ const Create = () => {
<div className="flex justify-between flex-wrap">
<div className="w-full md:w-[48%] mt-2">
<div className="text-[14px] text-[#212325] font-medium ">Name</div>
<input className="projectsInput text-[14px] font-normal text-[#212325] rounded-[10px]" name="username" value={values.username} onChange={handleChange} />
<input className="projectsInput text-[14px] font-normal text-[#212325] rounded-[10px]" name="name" type="" value={values.name} onChange={handleChange} />
</div>
<div className="w-full md:w-[48%] mt-2">
<div className="text-[14px] text-[#212325] font-medium ">Email</div>
Expand All @@ -139,7 +139,13 @@ const Create = () => {
{/* Password */}
<div className="w-full md:w-[48%] mt-2">
<div className="text-[14px] text-[#212325] font-medium ">Password</div>
<input className="projectsInput text-[14px] font-normal text-[#212325] rounded-[10px]" name="password" value={values.password} onChange={handleChange} />
<input
className="projectsInput text-[14px] font-normal text-[#212325] rounded-[10px]"
name="password"
type="password"
value={values.password}
onChange={handleChange}
/>
</div>
</div>
</div>
Expand Down