The build_form_schema API endpoint takes report_date as a parameter. This is in turn passed to the form_builder_service in order to determine the configuration that the activity forms should be rendered from. The report_date parameter is unnecessary as the service can fetch the date the report was created itself if passed the report_version_id.
To do:
[x] Change the build_form_schema API endpoint parameter from report_date:str to report_version_id: int
[x] Change the form_builder_service to receive the report_version_id from build_form_schema
[x] Fetch created_at from erc.report via the report -> report_version relationship
[x] Use that value as report_date in the form_builder_service
[x] Refactor the call in the frontend (ActivityForm.tsx) to pass the report_version_id instead of report_date
[x] Refactor ActivityInit.tsx to pass the report_version_id to ActivityForm instead of report_date
The
build_form_schema
API endpoint takesreport_date
as a parameter. This is in turn passed to theform_builder_service
in order to determine the configuration that the activity forms should be rendered from. Thereport_date
parameter is unnecessary as the service can fetch the date the report was created itself if passed thereport_version_id
.To do:
build_form_schema
API endpoint parameter fromreport_date:str
toreport_version_id: int
form_builder_service
to receive thereport_version_id
frombuild_form_schema
created_at
from erc.report via the report -> report_version relationshipreport_date
in the form_builder_servicereport_version_id
instead ofreport_date
ActivityInit.tsx
to pass thereport_version_id
toActivityForm
instead ofreport_date