From the course: The Freelance Stack: Real Project with Next.js and Strapi
Unlock this course with a free trial
Join today to access over 25,200 courses taught by industry experts.
Event data processing - Next.js Tutorial
From the course: The Freelance Stack: Real Project with Next.js and Strapi
Event data processing
So, looking at the data, what we want to do is we want to make it a little bit easier to process, a little bit easier to work with now when we pass it into our sign-up form. In order for us to do that, we're going to do something very similar to what we've done already before with the info blocks or the block articles, and we're going to write a function that processes this kind of data. Now in here, if you look at it, we have to hook into event.data.data to get to this element right here. But that's the one we want. So we're going to treat it as if we're going to be handed exactly this JSON here. And what do we want to return for that? Well, we want to have all of the attributes as a new object and we want to have the id attached to this element as well. So I'm going to write a new function here that I'm just going to call processEventData like that. And it's going to take an event as an input and what it will return is a new object with exactly the event attributes spread in, and on…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
-
-
-
(Locked)
Post requests in Strapi with the newsletter signup7m 7s
-
(Locked)
Hook up frontend to signup component in Strapi10m 16s
-
(Locked)
Strapi participant and event content type7m 21s
-
(Locked)
Feeding data into Strapi for all events6m 56s
-
(Locked)
Signup form JSX15m 50s
-
(Locked)
Styling: Signup form8m 56s
-
(Locked)
Signup form functionality: Sending data to Strapi from main events page18m 50s
-
(Locked)
Pregenerate individual event pages14m 12s
-
(Locked)
Event data processing4m 46s
-
(Locked)
Render individual event page based off Strapi data9m 43s
-
(Locked)
Sign up for specific event8m 56s
-
(Locked)
Fetch and filter upcoming events with a string query from Strapi15m 26s
-
(Locked)
Adjust featured items component for individual event page11m 26s
-
(Locked)
Styling: FeaturedItem component adjusted for event3m 45s
-
(Locked)
Fetch more events on individual event page & thank you10m 45s
-
(Locked)
-