EmailAttachmentLogindex.ts2 matches
67});
6869// Export the fetch handler
70export default app.fetch;
EmailAttachmentLogApp.tsx4 matches
3940useEffect(() => {
41const fetchAttachments = async () => {
42try {
43const response = await fetch("/api/attachments");
44if (!response.ok) {
45throw new Error("Failed to fetch attachments");
46}
47const data = await response.json();
54};
5556fetchAttachments();
57}, []);
58
105});
106107export default app.fetch;
EmailAttachmentLogindex.ts2 matches
56});
5758// Export the fetch handler
59export default app.fetch;
EmailAttachmentLogApp.tsx4 matches
67}
6869// Fetch attachments
70fetch('/api/attachments')
71.then(response => {
72if (!response.ok) {
73throw new Error('Failed to fetch attachments');
74}
75return response.json();
80})
81.catch(err => {
82console.error('Error fetching attachments:', err);
83setError('Failed to load attachments');
84setLoading(false);
15const start = performance.now();
16try {
17res = await fetch(url);
18end = performance.now();
19status = res.status;
25} catch (e) {
26end = performance.now();
27reason = `couldn't fetch: ${e}`;
28ok = false;
29}
templateTwitterAlertmain.tsx1 match
19: Math.floor((Date.now() - 2 * 24 * 60 * 60 * 1000) / 1000);
2021// Fetch and log tweets
22const response = await socialDataSearch(`${query} since_time:${timeFrame}`);
23console.log("Response from socialDataSearch:", response);
stevensDemosendDailyBrief.ts1 match
135const lastSunday = today.startOf("week").minus({ days: 1 });
136137// Fetch relevant memories using the utility function
138const memories = await getRelevantMemories();
139
stevensDemoNotebookView.tsx12 matches
67const [currentPage, setCurrentPage] = useState(1);
6869const fetchMemories = useCallback(async () => {
70setLoading(true);
71setError(null);
72try {
73const response = await fetch(API_BASE);
74if (!response.ok) {
75throw new Error(`HTTP error! status: ${response.status}`);
78setMemories(data);
79} catch (e) {
80console.error("Failed to fetch memories:", e);
81setError(e.message || "Failed to fetch memories.");
82} finally {
83setLoading(false);
8687useEffect(() => {
88fetchMemories();
89}, [fetchMemories]);
9091const handleAddMemory = async (e: React.FormEvent) => {
100101try {
102const response = await fetch(API_BASE, {
103method: "POST",
104headers: { "Content-Type": "application/json" },
112setNewMemoryTags("");
113setShowAddForm(false);
114await fetchMemories();
115} catch (e) {
116console.error("Failed to add memory:", e);
123124try {
125const response = await fetch(`${API_BASE}/${id}`, {
126method: "DELETE",
127});
129throw new Error(`HTTP error! status: ${response.status}`);
130}
131await fetchMemories();
132} catch (e) {
133console.error("Failed to delete memory:", e);
155156try {
157const response = await fetch(`${API_BASE}/${editingMemory.id}`, {
158method: "PUT",
159headers: { "Content-Type": "application/json" },
164}
165setEditingMemory(null);
166await fetchMemories();
167} catch (e) {
168console.error("Failed to update memory:", e);
stevensDemoindex.ts2 matches
135));
136137// HTTP vals expect an exported "fetch handler"
138export default app.fetch;