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/$%7Bsuccess?q=fetch&page=49&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 10026 results for "fetch"(1046ms)

PointofSaleProductList.tsx6 matches

@Lenny254•Updated 1 day ago
31 const [formLoading, setFormLoading] = useState(false);
32
33 const fetchProducts = async () => {
34 try {
35 setLoading(true);
36 const response = await fetch("/api/products", {
37 headers: {
38 "Authorization": `Bearer ${token}`
41
42 if (!response.ok) {
43 throw new Error("Failed to fetch products");
44 }
45
59
60 useEffect(() => {
61 fetchProducts();
62 }, [token]);
63
119 };
120
121 const response = await fetch("/api/products", {
122 method: "POST",
123 headers: {
140 });
141 setShowForm(false);
142 fetchProducts();
143 } else {
144 throw new Error(data.error || "Failed to create product");

PointofSaleDashboard.tsx4 matches

@Lenny254•Updated 1 day ago
14
15 useEffect(() => {
16 const fetchStats = async () => {
17 try {
18 const response = await fetch("/api/dashboard/stats", {
19 headers: {
20 "Authorization": `Bearer ${token}`
23
24 if (!response.ok) {
25 throw new Error("Failed to fetch dashboard data");
26 }
27
40 };
41
42 fetchStats();
43 }, [token]);
44

PointofSaledashboard.ts2 matches

@Lenny254•Updated 1 day ago
17 return c.json({ success: true, data: stats });
18 } catch (error) {
19 console.error("Error fetching dashboard stats:", error);
20 return c.json({ success: false, error: "Failed to fetch dashboard statistics" }, 500);
21 }
22});

PointofSalesales.ts4 matches

@Lenny254•Updated 1 day ago
71 return c.json({ success: true, data: sale });
72 } catch (error) {
73 console.error("Error fetching sale:", error);
74 return c.json({ success: false, error: "Failed to fetch sale" }, 500);
75 }
76});
84 return c.json({ success: true, data: sales });
85 } catch (error) {
86 console.error("Error fetching sales:", error);
87 return c.json({ success: false, error: "Failed to fetch sales" }, 500);
88 }
89});

PointofSaleproducts.ts4 matches

@Lenny254•Updated 1 day ago
24 return c.json({ success: true, data: products });
25 } catch (error) {
26 console.error("Error fetching products:", error);
27 return c.json({ success: false, error: "Failed to fetch products" }, 500);
28 }
29});
44 return c.json({ success: true, data: product });
45 } catch (error) {
46 console.error("Error fetching product:", error);
47 return c.json({ success: false, error: "Failed to fetch product" }, 500);
48 }
49});

TownieuseUser.tsx4 matches

@maxm•Updated 1 day ago
8 const [error, setError] = useState(null);
9
10 const fetchData = async () => {
11 try {
12 const userEndpoint = new URL(USER_ENDPOINT, window.location.origin);
13
14 const res = await fetch(userEndpoint);
15 const data = await res.json();
16 if (!res.ok) {
33
34 useEffect(() => {
35 fetchData();
36 }, []);
37
38 return { data, loading, error, refetch: fetchData };
39}
40

TownieuseProject.tsx5 matches

@maxm•Updated 1 day ago
9 const [error, setError] = useState(null);
10
11 const fetchData = async () => {
12 try {
13 const projectEndpoint = new URL(PROJECT_ENDPOINT, window.location.origin);
17 if (branchId) filesEndpoint.searchParams.append("branchId", branchId);
18
19 const { project } = await fetch(projectEndpoint).then((res) =>
20 res.json()
21 );
22 const { files } = await fetch(filesEndpoint).then((res) => res.json());
23
24 setData({ project, files });
34 useEffect(() => {
35 if (!projectId) return;
36 fetchData();
37 }, [projectId, branchId]);
38
39 return { data, loading, error, refetch: fetchData };
40}
41

TownieuseProjects.tsx4 matches

@maxm•Updated 1 day ago
8 const [error, setError] = useState(null);
9
10 const fetchData = async () => {
11 try {
12 const res = await fetch(ENDPOINT);
13 const data = await res.json();
14 if (!res.ok) {
32
33 useEffect(() => {
34 fetchData();
35 }, []);
36
37 return { data, loading, error, refetch: fetchData };
38}
39

TownieuseCreateProject.tsx1 match

@maxm•Updated 1 day ago
19 setError(null);
20 try {
21 const res = await fetch(ENDPOINT, {
22 method: "POST",
23 headers: {

TownieuseCreateBranch.tsx1 match

@maxm•Updated 1 day ago
12 setData(null);
13 setError(null);
14 const res = await fetch(ENDPOINT, {
15 method: "POST",
16 body: JSON.stringify({

agentplex-deal-flow-email-fetch1 file match

@anandvc•Updated 2 days ago

proxyFetch2 file matches

@vidar•Updated 5 days ago