diff --git a/src/components/Homepage/Founders/Founders.js b/src/components/Homepage/Founders/Founders.js index 948d490..4db682b 100644 --- a/src/components/Homepage/Founders/Founders.js +++ b/src/components/Homepage/Founders/Founders.js @@ -1,7 +1,8 @@ import React from "react"; import "./Founders.css"; import Founder from "./Founder/Founder"; -import { Link } from "react-router-dom"; +import { Link } from 'react-router-dom'; + const Founders = () => { return ( @@ -36,9 +37,10 @@ const Founders = () => { out to find a solution, which led us to Groundworks. Our way to revolutionise how companies connect with students worldwide.

- - - + + ); diff --git a/src/components/LoginRegister/RegisterPortal/RegisterPortal.js b/src/components/LoginRegister/RegisterPortal/RegisterPortal.js index 37f4f4f..71a3c2a 100644 --- a/src/components/LoginRegister/RegisterPortal/RegisterPortal.js +++ b/src/components/LoginRegister/RegisterPortal/RegisterPortal.js @@ -1,10 +1,12 @@ import React, { useState } from "react"; +import {withRouter} from 'react-router-dom' import "./RegisterPortal.css"; import axios from "axios"; -const RegisterPortal = () => { - const [user, setUser] = useState(""); +const RegisterPortal = (props) => { + const [user, setUser] = useState(""); + const [redirect, setRedirect] = useState(false); const [data, setData] = useState({ userName: "", email: "", @@ -22,13 +24,18 @@ const RegisterPortal = () => { const handleSubmit = e => { e.preventDefault(); + setRedirect(!redirect); console.log(data); console.log(user); - + console.log(props); const addRegister = async () => { console.log(`Fake submitting: ${data}`); try { - return await axios.post(`/api/${user}/join`, data); + const response = await axios.post(`/api/${user}/join`, data); + if(response.status === 200 ) // check if response status is ok + {props.history.push('/StudentSignup') + //success scenario + } } catch (error) { console.error(error); } @@ -43,7 +50,13 @@ const RegisterPortal = () => { password: "", userType: "" }); - }; + } + + // render() { + // if (redirect === true) { + // return + // } + // } return (
@@ -112,4 +125,4 @@ const RegisterPortal = () => { ); }; -export default RegisterPortal; +export default withRouter(RegisterPortal); diff --git a/src/components/NewBrief/NewBriefForm/NewBriefForm.js b/src/components/NewBrief/NewBriefForm/NewBriefForm.js index 6872f15..6059b45 100644 --- a/src/components/NewBrief/NewBriefForm/NewBriefForm.js +++ b/src/components/NewBrief/NewBriefForm/NewBriefForm.js @@ -9,10 +9,14 @@ const ClientNewBriefForm = () => { projectName: "", projectBrief: "", projectDeadline: "", - estimatedWorkload: "", - projectPrice: "", + estimatedWorkload: 0, + projectPrice: 0, + additionalInfo: "", studentSkills: "", - additionalInfo: "" + // jobClient: "5d08cff93136b6429a9c01eb", + client: "testing" + // jobType: "new" + }); const handleChange = event => { @@ -43,7 +47,9 @@ const ClientNewBriefForm = () => { estimatedWorkload: "", projectPrice: "", studentSkills: "", - additionalInfo: "" + additionalInfo: "", + // jobType: "new", + client: "5d08cff93136b6429a9c01eb" }); }; return (