conservancy / reimbursinator

Git Up GitHub: https://GiveUpGitHub.org
https://GiveUpGitHub.org
GNU Affero General Public License v3.0
7 stars 6 forks source link

Add frontend save section functionality #72

Closed ppdom closed 5 years ago

ppdom commented 5 years ago

This update will send data to the section update endpoint using the HTTP PUT request method. I made some minor changes to the section method in views.py to return JSON showing the content of request.data. To test, log in, create report, open the web dev console, enter some data in a section's input fields and click save. You should see the html element of that section's form in the console with the attributes data-rid and data-sid. These correspond to the report_pk and section id, respectively. If the PUT is successful an alert popup should appear on the page with the contents of request.data and the report_pk and section id. Those should match the ones on the form. The keys and values of the request.data entry should match what you entered and the keys should match the name attribute of the form's inputs. Repeat the process with edit report.