Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
agnlez committed Aug 7, 2024
1 parent 9d1e81d commit a7ce5ae
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/app/(static)/events-news/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,14 @@ const prefetchData = async (queryClient: QueryClient) => {
queryKey: queryKeys.events.upcoming.queryKey,
queryFn: async () => {
try {
console.log('******FETCHING UPCOMING EVENTS*****');
const response = await fetch(`${APP_HOSTNAME}/events`);
if (!response.ok) {
console.warn('****** NOT OK *****');
throw new Error('Failed to fetch upcoming events');
}

console.log('***** BODY *****', response.body);
const data = await response.json();
return data?.data.upcoming;
} catch (err) {
Expand Down Expand Up @@ -68,6 +71,7 @@ const prefetchData = async (queryClient: QueryClient) => {
export default async function EventsNews() {
const queryClient = new QueryClient();

console.log('*****PREFETCH *****');
await prefetchData(queryClient);

return (
Expand Down

0 comments on commit a7ce5ae

Please sign in to comment.