You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the user saves a scholarship, we should also save that scholarship to the Atila database
To prevent CORS issues, we will create a dedicated endpoint in atila-scholarships-bot that is specifically for saving scholarships and can be accessed from any client
The logic to save to an external API is already here: https://github.com/ademidun/atila-scholarship-helper-extension/blob/59a9812822c3637498a4e2d742740bd765fde949/src/services/AtilaAPI.ts#L7
All you need to do is:
change the Endpoint URL from saving directly to the atila-django service to saving to
atila-scholarships-botapiUrl: https://github.com/ademidun/atila-scholarship-helper-extension/blob/59a9812822c3637498a4e2d742740bd765fde949/src/services/Environment.ts#L1-L7Add a test to ensure the API is being saved as indicated in this TODO:
https://github.com/ademidun/atila-scholarship-helper-extension/blob/59a9812822c3637498a4e2d742740bd765fde949/src/services/AtilaAPI.ts#L18
Add documentation explaining that to test the saving logic users need to run both the
atila-scholarship-botserver andatila-djangoserverAdd the picture below to the documentation as well. (source)
Context
Here is a good tutorial specfically for making fetch requests from a background script:
https://freshman.tech/first-chrome-extension/#fetch-the-background-image
https://github.com/Freshman-tech/freshtab/
See:
https://github.com/ademidun/atila-form-filler-chrome-extension/pull/16
https://docs.google.com/document/d/1yKdPcEttBD4s4F55sxaGisZriKxUWSm08XsZ6WNXYMA/edit
https://stackoverflow.com/questions/5207160/what-is-a-csrf-token-what-is-its-importance-and-how-does-it-work