For this assignment you will be using the JavaScript function fetch
to make an API request to the backend and update a datalist to support
dynamic autocompletion based on data from the server.
To complete this project you will want to:
- listen to
inputevents on the#student-nameinput fetchto/api/studentswith aGETrequest and provide aqargument for the current value of#student-name/api/studentswill respond with JSON containing a single propertystudents. Thestudentsproperty will be associated with an array of strings. Each string is the name of a BCCA student/graduate whose name contains the value provided forq.- populate the
#student-namesdatalistwithoptions for each of the returned names. Don't forget to empty thedatalistout first.
This project doesn't require a database, so you don't have to do any interesting setup. Just run the server!
python3 manage.py runserver
This project uses a cypress test suite.
You should npm install to make sure cypress gets installed.
After that you can run npm test to start the cypress test runner.
From there you can press the Run All Specs button.
Don't forget to start your django server before running your cypress specs