feat: update Dockerfile and nginx configuration for improved API routing; modify events API response structure
This commit is contained in:
@@ -257,7 +257,7 @@ export default function EventsPage() {
|
||||
|
||||
useEffect(() => {
|
||||
eventsApi.getEvents(true)
|
||||
.then((res) => setEvents(res.data))
|
||||
.then((res) => setEvents(res.events))
|
||||
.catch(() => setEvents([]))
|
||||
.finally(() => setLoading(false));
|
||||
}, []);
|
||||
|
||||
@@ -173,7 +173,7 @@ export const eventsApi = {
|
||||
getEvents: (publicOnly = true) => {
|
||||
const q = new URLSearchParams({ limit: '50' });
|
||||
if (publicOnly) q.set('public', 'true');
|
||||
return apiFetch<{ data: EventPost[]; total: number; page: number; pages: number }>(
|
||||
return apiFetch<{ events: EventPost[]; total: number; page: number; pages: number }>(
|
||||
`/events?${q}`
|
||||
);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user