From 4c6531961da21c2706f70fbf7f06ebb697affd00 Mon Sep 17 00:00:00 2001 From: irving11119 Date: Sat, 11 Feb 2023 04:38:12 +0800 Subject: [PATCH] Add new assessment method --- components/NewAssessment/assessment.tsx | 19 +++++++++++++++++++ components/coporateGrid.tsx | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/components/NewAssessment/assessment.tsx b/components/NewAssessment/assessment.tsx index 198756d..35049b9 100644 --- a/components/NewAssessment/assessment.tsx +++ b/components/NewAssessment/assessment.tsx @@ -24,9 +24,26 @@ interface AssesorProps { export default function NewAssessment({stateChanger, open}: AssesorProps) { + var [url, setUrl] = useState(''); const handleClose = () => { stateChanger(false); } + + const newAssessmentPost = () => { + fetch("https://asia-southeast1-starlit-array-328711.cloudfunctions.net/hack4good/api/assessment/add", { + method: 'POST', + mode: 'cors', + body: JSON.stringify({ + companyName: 'visa', + timestamp: 1676060952, + url: {url}, + assessInfo: "im tired" + }) + },).then((response) => { + console.log(response); + stateChanger(false); + }) + } return ( {setUrl(event.target.value)}} sx={{ borderRadius: "1px" }} /> @@ -153,6 +171,7 @@ export default function NewAssessment({stateChanger, open}: AssesorProps) {