From e13cb7e0bf593d77154f6691b583ea74244e107b Mon Sep 17 00:00:00 2001 From: armsp Date: Thu, 3 Aug 2023 17:27:07 +0200 Subject: [PATCH] fixing submission request body --- src/components/Submit.jsx | 6 +-- src/components/SubmitArticle.js | 68 ---------------------------- src/components/SubmitWithCountry.jsx | 8 ++-- 3 files changed, 7 insertions(+), 75 deletions(-) delete mode 100644 src/components/SubmitArticle.js diff --git a/src/components/Submit.jsx b/src/components/Submit.jsx index 7080ce9..ee8f877 100644 --- a/src/components/Submit.jsx +++ b/src/components/Submit.jsx @@ -96,9 +96,9 @@ const SubmissionForm = ({tablename}) => { diff --git a/src/components/SubmitArticle.js b/src/components/SubmitArticle.js deleted file mode 100644 index c548e7b..0000000 --- a/src/components/SubmitArticle.js +++ /dev/null @@ -1,68 +0,0 @@ -import { useState } from 'react'; -import { TextField, Button, CircularProgress, Box } from '@mui/material'; -import * as React from 'react'; - -const SubmitArticle = () => { - const [article, setArticle] = useState(''); - const [mediaOrg, setMediaOrg] = useState(''); - const [url, setUrl] = useState(''); - const [iam, setIam] = useState(''); - const [isLoading, setIsLoading] = useState(false); - - const handleSubmit = async () => { - setIsLoading(true); - const requestBody = { - article, - mediaOrg, - url, - iam, - }; - try { - const response = await fetch('https://sample.com/submit', { - method: 'POST', - headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify(requestBody), - }); - console.log('response:', response); - setIsLoading(false); - setArticle(''); - setMediaOrg(''); - setUrl(''); - setIam(''); - } catch (error) { - console.error('error:', error); - setIsLoading(false); - } - }; - - return ( - - -

Submit new article here

-
- - setArticle(event.target.value)} - /> - setMediaOrg(event.target.value)} - /> - setUrl(event.target.value)} /> - setIam(event.target.value)} /> - - - - - {isLoading && } -
- ); -}; -export default SubmitArticle; \ No newline at end of file diff --git a/src/components/SubmitWithCountry.jsx b/src/components/SubmitWithCountry.jsx index 6b12906..7666ec7 100644 --- a/src/components/SubmitWithCountry.jsx +++ b/src/components/SubmitWithCountry.jsx @@ -506,7 +506,7 @@ const SubmissionFormWithCountry = () => { <> {successMessage}
- Visit the link to view the status of your submission: + Visit the link to view the status of your submission. Please wait on the page that opens when you click the link. Weather your submission was accepted or rejected will appear as a reply below your submission details: {' '} {successLink} @@ -551,9 +551,9 @@ const SubmissionFormWithCountry = () => {