Time of the challenge: 30-60 minnutes.
**
In this first part of the challenge you will have to process JSON data and save it into a file using a library called jq.
Reference: https://stedolan.github.io/jq/
-
Go to this online tool: https://jqplay.org/
-
Copy/paste the data from the
./public/db-dev-deals-200.json
file into the "JSON" field then do the following:- Remove any "faulty deals" (deals without a
dealID
). - Output only the following properties from the deals:
dealID, info, template, activity, variables, users
. (summarize the deals to these fields only, remove the rest) - Order them by their
info.updated
value (timestamp). - Copy the output into a file named
deals.json
.
- Remove any "faulty deals" (deals without a
For the second part, we will use the data that we have processed to power an autocomplete.
-
Add the JSON file from last step in the
/public
folder. -
Create a new page in the app call “Deals”.
- Add a link in the
<nav>
to access the new Deals page. - Using any npm package you want, implement an autocomplete input field that will search deals from the JSON file using the deals names.
- Display the results in this format:
“({dealID}) : {name}”
- When a deal in the result list is selected, display all its properties under the autocomplete.
- Add a link in the
And you're done! 🎉