910useEffect(() => {
11fetchExperiences();
12}, []);
1314async function fetchExperiences() {
15try {
16const response = await fetch("/experiences");
17const data = await response.json();
18setExperiences(data);
19} catch (error) {
20console.error("Failed to fetch experiences", error);
21}
22}
28setIsSubmitting(true);
29try {
30const response = await fetch("/submit", {
31method: "POST",
32headers: { "Content-Type": "application/json" },
36if (response.ok) {
37setExperience("");
38fetchExperiences();
39}
40} catch (error) {
spacexspaceximage.tsx1 match
34export default async function(req: Request): Promise<Response> {
5// const data = await fetch("https://moe-spacexapi.web.val.run").then((res) => res.json())
6// const l = data.launches[0]
7// console.log(l)
LUKOYESTUDYTRUSTmain.tsx1 match
100101try {
102const response = await fetch("/register", {
103method: "POST",
104headers: {
ObawalLearningHUBmain.tsx2 matches
43setError(null);
44try {
45const response = await fetch("/auth/google", { method: "POST" });
46if (!response.ok) {
47throw new Error("Authentication failed");
72const handleLogout = async () => {
73try {
74await fetch("/auth/logout", { method: "POST" });
75setUser(null);
76localStorage.removeItem("obawal_user");
NaijaHandleFindermain.tsx12 matches
25setIsUsernameModalOpen(true);
26}
27fetchJobs();
28fetchChatMessages();
29}, []);
3031const fetchJobs = async () => {
32try {
33const response = await fetch('/jobs');
34const data = await response.json();
35setJobs(data);
36} catch (error) {
37console.error('Error fetching jobs:', error);
38}
39};
4041const fetchChatMessages = async () => {
42try {
43const response = await fetch('/chat');
44const data = await response.json();
45setChatMessages(data);
46} catch (error) {
47console.error('Error fetching chat messages:', error);
48}
49};
67}
68try {
69const response = await fetch('/jobs', {
70method: 'POST',
71headers: { 'Content-Type': 'application/json' },
73});
74if (response.ok) {
75fetchJobs();
76setNewJob({ title: '', company: '', description: '', location: '', salary: '' });
77}
88}
89try {
90const response = await fetch('/chat', {
91method: 'POST',
92headers: { 'Content-Type': 'application/json' },
94});
95if (response.ok) {
96fetchChatMessages();
97setNewMessage('');
98}
Voice_Remindermain.tsx7 matches
1213useEffect(() => {
14// Fetch existing reminders on component mount
15const fetchReminders = async () => {
16try {
17const response = await fetch('/list-reminders');
18if (!response.ok) {
19throw new Error('Failed to fetch reminders');
20}
21const data = await response.json();
32};
3334fetchReminders();
35}, []);
3672formData.append('reminderDate', parsedDate.toISOString());
7374const response = await fetch('/save-reminder', {
75method: 'POST',
76body: formData
250: null;
251} catch (error) {
252console.error(`Error fetching reminder ${key}:`, error);
253return null;
254}
Flashcard_Generatormain.tsx1 match
21const generateFlashcards = async () => {
22try {
23const response = await fetch('/generate-flashcards', {
24method: 'POST',
25body: JSON.stringify({ content }),
42current_status?: string | null;
43solicitation_topics?: SolicitationTopic[];
44fetch_error?: string;
45id?: string;
46}
377+ " try {"
378+ " var apiUrl = window.location.pathname + '?action=analyze_sbir&format=json';"
379+ " var response = await fetch(apiUrl, {"
380+ " method: 'POST',"
381+ " headers: {"
517}
518519async function fetchSBIRSolicitations(
520criteria: SBIRSearchCriteria,
521log: LogFunction,
523const MAX_ROWS = 10;
524const BASE_URL = "https://api.www.sbir.gov/public/api/solicitations";
525const logPrefix = "SBIR API Fetch";
526527log("[STEP] " + logPrefix + ": Building API request...");
544545const apiUrl = BASE_URL + "?" + params.toString();
546log("[INFO] " + logPrefix + ": Fetching URL: " + apiUrl);
547548try {
549const response = await fetch(apiUrl, {
550method: "GET",
551headers: {
627628log(
629"[SUCCESS] " + logPrefix + ": Successfully fetched and processed " + validSolicitations.length
630+ " solicitations.",
631);
632return { solicitations: validSolicitations, rawCount: rawCount };
633} catch (error) {
634log("[CRITICAL ERROR] " + logPrefix + ": Unexpected error during fetch/processing: " + error.message);
635console.error(logPrefix + " Unexpected Error:", error);
636return { error: "Unexpected server error during SBIR API fetch: " + error.message };
637}
638}
648649try {
650log("[STEP] Fetching SBIR Solicitations from API...");
651const fetchResult = await fetchSBIRSolicitations(criteria, log);
652653if (fetchResult.error) {
654log("[ERROR] Failed to fetch solicitations from SBIR API: " + fetchResult.error);
655return { error: "Failed to retrieve funding opportunities from SBIR.gov.", details: fetchResult.error };
656}
657658solicitations = fetchResult.solicitations || [];
659660if (solicitations.length === 0) {
805intermediate_results: {
806userCriteria: criteria,
807fetchedSolicitationsCount: solicitations.length,
808analysisResults: analysisResults,
809},
jobBoardWithChatAppmain.tsx19 matches
5051try {
52const response = await fetch('/post-job', {
53method: 'POST',
54headers: { 'Content-Type': 'application/json' },
130131try {
132const response = await fetch('/send-message', {
133method: 'POST',
134headers: { 'Content-Type': 'application/json' },
146147useEffect(() => {
148async function fetchMessages() {
149try {
150const response = await fetch('/get-messages');
151const fetchedMessages = await response.json();
152setMessages(fetchedMessages);
153} catch (error) {
154console.error('Error fetching messages:', error);
155}
156}
157fetchMessages();
158const interval = setInterval(fetchMessages, 5000);
159return () => clearInterval(interval);
160}, []);
193194useEffect(() => {
195async function fetchJobs() {
196try {
197const response = await fetch('/get-jobs');
198const fetchedJobs = await response.json();
199setJobs(fetchedJobs);
200} catch (error) {
201console.error('Error fetching jobs:', error);
202}
203}
204if (userName) {
205fetchJobs();
206}
207}, [userName]);
310});
311} catch (error) {
312console.error("Job fetching error:", error);
313return new Response(`Job fetching error: ${error.message}`, { status: 500 });
314}
315}
326});
327} catch (error) {
328console.error("Message fetching error:", error);
329return new Response(`Message fetching error: ${error.message}`, { status: 500 });
330}
331}
weddingRSVPTOForevermain.tsx1 match
5556try {
57const response = await fetch('/submit-rsvp', {
58method: 'POST',
59headers: { 'Content-Type': 'application/json' },