pledge4future / WePledge

WebApp to calculate work related CO2e emissions from heating and electricity consumption as well as business trips and commuting.
https://pledge4future.org
GNU General Public License v3.0
6 stars 2 forks source link

Include enum endpoints in the frontend. #239

Open codingfabi opened 1 year ago

codingfabi commented 1 year ago

Extracted from #234

The enum endpoints include:

sami1riaz commented 1 year ago

@codingfabi, I'm not sure what you mean here, can you please specify

codingfabi commented 1 year ago

Sure, the dropdown selection options in the forms are currently hardcoded in the frontend. However, selection options are dependent on the co2calculator package and change from time to time. There already are some endpoints we can query that return the co2calculator enums (e.g. https://github.com/pledge4future/WePledge/wiki/Backend:-GraphQL-Queries#query-dropdown-options-for-fuel_type-and-unit-attribute). This would avoid out-of-sync issues between frontend and backend.