mirror of
https://github.com/UofCBaja/BajaUofCWebsite.git
synced 2025-07-08 12:17:13 -06:00
feat(Interview Booking): Removed Header, added starting info, added test API
This commit is contained in:
@ -1,16 +1,29 @@
|
||||
import { useState } from "react";
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
const InterviewForm = () => {
|
||||
const [isButtonDisabled, setIsButtonDisabled] = useState(false);
|
||||
useEffect(() => {
|
||||
test();
|
||||
}, []);
|
||||
const formsubmit = async (event) => {
|
||||
event.preventDefault();
|
||||
setIsButtonDisabled(true);
|
||||
await new Promise((res) => setTimeout(res, 10000));
|
||||
await new Promise((res) => setTimeout(res, 1000));
|
||||
const formData = new FormData(event.target);
|
||||
const formObject = Object.fromEntries(formData.entries());
|
||||
await console.log("Form Data:", formObject);
|
||||
setIsButtonDisabled(false);
|
||||
};
|
||||
const test = async () => {
|
||||
const res = await fetch(
|
||||
// "https://bajabackend.bajacloud.duckdns.org/getAppointments",
|
||||
"https://randomfox.ca/floof",
|
||||
{ method: "GET" }
|
||||
);
|
||||
let json = await res.json();
|
||||
await console.log(json);
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<form onSubmit={formsubmit}>
|
||||
@ -27,6 +40,7 @@ const InterviewForm = () => {
|
||||
Submit
|
||||
</button>
|
||||
</form>
|
||||
<button onClick={test}> test</button>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
Reference in New Issue
Block a user