feat(Interview Booking): Removed Header, added starting info, added test API

This commit is contained in:
2025-01-25 11:19:44 -07:00
parent 9a139619e3
commit 0bbca385e3
3 changed files with 21 additions and 4 deletions

View File

@ -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>
</>
);
};