Val Town Code SearchReturn to Val Town

API Access

You can access search results via JSON API by adding format=json to your query:

https://codesearch.val.run/image-url.jpg?q=fetch&page=223&format=json

For typeahead suggestions, use the /typeahead endpoint:

https://codesearch.val.run/typeahead?q=fetch

Returns an array of strings in format "username" or "username/projectName"

Found 13579 results for "fetch"(2239ms)

JobPostJobForm.tsx1 match

@Vilho•Updated 6 days ago
27
28 try {
29 const response = await fetch('/api/jobs', {
30 method: 'POST',
31 headers: {

JobPostJobBoard.tsx4 matches

@Vilho•Updated 6 days ago
9 const [showForm, setShowForm] = useState(false);
10
11 const fetchJobs = async () => {
12 try {
13 const response = await fetch('/api/jobs');
14 if (response.ok) {
15 const jobsData = await response.json();
17 }
18 } catch (error) {
19 console.error('Error fetching jobs:', error);
20 } finally {
21 setLoading(false);
24
25 useEffect(() => {
26 fetchJobs();
27 }, []);
28

JobPostchat.ts2 matches

@Vilho•Updated 6 days ago
11 return c.json(messages);
12 } catch (error) {
13 console.error("Error fetching chat messages:", error);
14 return c.json({ error: "Failed to fetch messages" }, 500);
15 }
16});

JobPostjobs.ts2 matches

@Vilho•Updated 6 days ago
11 return c.json(jobPostings);
12 } catch (error) {
13 console.error("Error fetching jobs:", error);
14 return c.json({ error: "Failed to fetch jobs" }, 500);
15 }
16});

ftworkouts.ts4 matches

@newbienate•Updated 6 days ago
10 return c.json(workouts);
11 } catch (error) {
12 console.error("Error fetching workouts:", error);
13 return c.json({ error: "Failed to fetch workouts" }, 500);
14 }
15});
27 return c.json(workout);
28 } catch (error) {
29 console.error("Error fetching workout:", error);
30 return c.json({ error: "Failed to fetch workout" }, 500);
31 }
32});

ftmembers.ts6 matches

@newbienate•Updated 6 days ago
10 return c.json(members);
11 } catch (error) {
12 console.error("Error fetching members:", error);
13 return c.json({ error: "Failed to fetch members" }, 500);
14 }
15});
27 return c.json(member);
28 } catch (error) {
29 console.error("Error fetching member:", error);
30 return c.json({ error: "Failed to fetch member" }, 500);
31 }
32});
68 return c.json(bookings);
69 } catch (error) {
70 console.error("Error fetching member bookings:", error);
71 return c.json({ error: "Failed to fetch bookings" }, 500);
72 }
73});

ftMemberDashboard.tsx5 matches

@newbienate•Updated 6 days ago
22 useEffect(() => {
23 if (selectedMember) {
24 fetchMemberBookings(selectedMember.id);
25 }
26 }, [selectedMember]);
27
28 const fetchMemberBookings = async (memberId: number) => {
29 try {
30 setLoading(true);
31 const response = await fetch(`/api/members/${memberId}/bookings`);
32 const bookings = await response.json();
33 setMemberBookings(bookings);
34 } catch (error) {
35 console.error('Error fetching member bookings:', error);
36 } finally {
37 setLoading(false);
43 try {
44 setLoading(true);
45 const response = await fetch('/api/members', {
46 method: 'POST',
47 headers: { 'Content-Type': 'application/json' },

ftindex.ts3 matches

@newbienate•Updated 6 days ago
33 // Inject initial data to avoid extra round-trips
34 const [classes, members, workouts] = await Promise.all([
35 fetch(new Request("http://localhost/api/classes")).then(r => r.json()).catch(() => []),
36 fetch(new Request("http://localhost/api/members")).then(r => r.json()).catch(() => []),
37 fetch(new Request("http://localhost/api/workouts")).then(r => r.json()).catch(() => [])
38 ]);
39

ftClassSchedule.tsx1 match

@newbienate•Updated 6 days ago
21 setBookingLoading(classId);
22 try {
23 const response = await fetch(`/api/classes/${classId}/book`, {
24 method: 'POST',
25 headers: { 'Content-Type': 'application/json' },

ftclasses.ts4 matches

@newbienate•Updated 6 days ago
10 return c.json(classes);
11 } catch (error) {
12 console.error("Error fetching classes:", error);
13 return c.json({ error: "Failed to fetch classes" }, 500);
14 }
15});
27 return c.json(classData);
28 } catch (error) {
29 console.error("Error fetching class:", error);
30 return c.json({ error: "Failed to fetch class" }, 500);
31 }
32});

FetchBasic2 file matches

@ther•Updated 8 hours ago

GithubPRFetcher

@andybak•Updated 3 days ago