Compare commits

..

No commits in common. "f52201b683f369f9741bd94f09b3929d87f5aa24" and "857d61e09d4d50c73120571eb0a3a461e18a1bc1" have entirely different histories.

6 changed files with 8 additions and 10 deletions

View File

@ -1 +0,0 @@
REACT_APP_BACKEND_BASE_URL=http://localhost:8002

View File

@ -1 +0,0 @@
REACT_APP_BACKEND_BASE_URL=https://forms-backend.alttd.com

View File

@ -124,7 +124,7 @@ export const apply: FormData = {
required: false, required: false,
}, },
], ],
backend: `${process.env.REACT_APP_BACKEND_BASE_URL}/api/apply/staffApplication`, backend: 'https://forms-backend.alttd.com/api/apply/staffApplication',
userInput: {username: '', email: '', discord: '', pc_requirements: '' userInput: {username: '', email: '', discord: '', pc_requirements: ''
, age: '', pronoun: '', join_date: '', avg_time: '', available_days: '', available_time: '', staff_experience: '' , age: '', pronoun: '', join_date: '', avg_time: '', available_days: '', available_time: '', staff_experience: ''
, plugin_experience: '', why_staff: '', expectations_mod: '', other: '' , plugin_experience: '', why_staff: '', expectations_mod: '', other: ''

View File

@ -28,7 +28,7 @@ export const contact: FormData = {
required: true, required: true,
}, },
], ],
backend: `${process.env.REACT_APP_BACKEND_BASE_URL}/api/contact/submitContactForm`, backend: 'https://forms-backend.alttd.com/api/contact/submitContactForm',
userInput: {username: '', email: '', question: ''}, userInput: {username: '', email: '', question: ''},
spec: Yup.object().shape({ spec: Yup.object().shape({
username: Yup.string() username: Yup.string()

View File

@ -15,23 +15,23 @@ const GenericForm = (formData: FormData) => {
const [currentStep, setCurrentStep] = useState<number>(0); const [currentStep, setCurrentStep] = useState<number>(0);
const handleSubmit = async (formikValues: FormikValues) => { const handleSubmit = async (e: FormikValues) => {
try { try {
const response = await fetch(backend, { const response = await fetch(backend, {
method: 'POST', method: 'POST',
headers: { headers: {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
}, },
body: JSON.stringify(formikValues) body: JSON.stringify(e)
}) })
if (!response.ok) { if (!response.ok) {
let json: string = JSON.stringify(formikValues); let json: string = JSON.stringify(steps);
const blob = new Blob([json], {type: "application/json"}); const blob = new Blob([json], {type: "application/json"});
const url = URL.createObjectURL(blob); const url = URL.createObjectURL(blob);
const link = document.createElement('a'); const link = document.createElement('a');
link.href = url; link.href = url;
link.download = 'your_form_data.json'; link.download = 'form_data.json';
link.click(); link.click();
URL.revokeObjectURL(url); URL.revokeObjectURL(url);
//TODO clean up //TODO clean up
@ -39,7 +39,7 @@ const GenericForm = (formData: FormData) => {
} else { } else {
navigate('/verify-email', { navigate('/verify-email', {
state: { state: {
email: formikValues['email'] email: e['email']
} }
}); });
} }

View File

@ -42,7 +42,7 @@ const VerifyMail: FC = () => {
eMail: email eMail: email
} }
console.log(verificationData); console.log(verificationData);
fetch(`${process.env.REACT_APP_BACKEND_BASE_URL}/api/verify_email/form`, { fetch('https://forms-backend.alttd.com/api/verify_email/form', {
method: 'POST', method: 'POST',
headers: { headers: {
'Content-Type': 'application/json', 'Content-Type': 'application/json',