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=206&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 13384 results for "fetch"(756ms)

JobJobBoard.tsx6 matches

@JayB•Updated 5 days ago
10 const [error, setError] = useState<string | null>(null);
11
12 const fetchJobs = async () => {
13 try {
14 setLoading(true);
15 const response = await fetch('/api/jobs');
16 const result: ApiResponse<Job[]> = await response.json();
17
20 setError(null);
21 } else {
22 setError(result.error || 'Failed to fetch jobs');
23 }
24 } catch (err) {
25 setError('Failed to fetch jobs');
26 } finally {
27 setLoading(false);
40
41 try {
42 const response = await fetch(`/api/jobs/${jobId}`, {
43 method: 'DELETE'
44 });
57
58 useEffect(() => {
59 fetchJobs();
60 }, []);
61

AppChat.tsx2 matches

@Zee_paul•Updated 5 days ago
43 const loadMessages = async () => {
44 try {
45 const response = await fetch(`/api/chat/messages/${roomId}`);
46 const result = await response.json();
47
105 setSending(true);
106 try {
107 const response = await fetch('/api/chat/messages', {
108 method: 'POST',
109 headers: { 'Content-Type': 'application/json' },

Jobchat.ts1 match

@JayB•Updated 5 days ago
16 return c.json({
17 success: false,
18 error: "Failed to fetch messages"
19 } as ApiResponse<never>, 500);
20 }

Jobjobs.ts1 match

@JayB•Updated 5 days ago
16 return c.json({
17 success: false,
18 error: "Failed to fetch jobs"
19 } as ApiResponse<never>, 500);
20 }

AppApp.tsx6 matches

@Zee_paul•Updated 5 days ago
53 }
54
55 const response = await fetch(url);
56 const result = await response.json();
57
68 const loadCart = async () => {
69 try {
70 const response = await fetch(`/api/cart/${state.sessionId}`);
71 const result = await response.json();
72
81 const addToCart = async (productId: number, quantity: number = 1) => {
82 try {
83 const response = await fetch(`/api/cart/${state.sessionId}/add`, {
84 method: 'POST',
85 headers: { 'Content-Type': 'application/json' },
102 const updateCartItem = async (productId: number, quantity: number) => {
103 try {
104 const response = await fetch(`/api/cart/${state.sessionId}/update`, {
105 method: 'PUT',
106 headers: { 'Content-Type': 'application/json' },
121 const removeFromCart = async (productId: number) => {
122 try {
123 const response = await fetch(`/api/cart/${state.sessionId}/remove/${productId}`, {
124 method: 'DELETE'
125 });
139 const completeOrder = async (orderData: any) => {
140 try {
141 const response = await fetch('/api/orders', {
142 method: 'POST',
143 headers: { 'Content-Type': 'application/json' },

Appchat.ts3 matches

@Zee_paul•Updated 5 days ago
29 const response: ApiResponse<ChatMessage[]> = {
30 success: false,
31 error: "Failed to fetch messages"
32 };
33 return c.json(response, 500);
136 const response: ApiResponse<ChatRoom> = {
137 success: false,
138 error: "Failed to fetch chat room"
139 };
140 return c.json(response, 500);
155 const response: ApiResponse<ChatRoom[]> = {
156 success: false,
157 error: "Failed to fetch chat rooms"
158 };
159 return c.json(response, 500);

Apporders.ts2 matches

@Zee_paul•Updated 5 days ago
98 const response: ApiResponse<Order> = {
99 success: false,
100 error: "Failed to fetch order"
101 };
102 return c.json(response, 500);
126 const response: ApiResponse<OrderItem[]> = {
127 success: false,
128 error: "Failed to fetch order items"
129 };
130 return c.json(response, 500);

Appcart.ts1 match

@Zee_paul•Updated 5 days ago
35 const response: ApiResponse<CartSummary> = {
36 success: false,
37 error: "Failed to fetch cart"
38 };
39 return c.json(response, 500);

Appproducts.ts3 matches

@Zee_paul•Updated 5 days ago
17 const response: ApiResponse<Product[]> = {
18 success: false,
19 error: "Failed to fetch products"
20 };
21 return c.json(response, 500);
52 const response: ApiResponse<Product> = {
53 success: false,
54 error: "Failed to fetch product"
55 };
56 return c.json(response, 500);
72 const response: ApiResponse<Product[]> = {
73 success: false,
74 error: "Failed to fetch products by category"
75 };
76 return c.json(response, 500);

RobbieChatBox.tsx1 match

@Robbie•Updated 5 days ago
39 };
40
41 const response = await fetch('/api/chat', {
42 method: 'POST',
43 headers: {

GithubPRFetcher

@andybak•Updated 1 day ago

proxiedfetch1 file match

@jayden•Updated 2 days ago