Altinn / app-frontend-react

Altinn application React frontend
BSD 3-Clause "New" or "Revised" License
14 stars 24 forks source link

Make sure patch requests sets the correct `language` param #2046

Closed bjosttveit closed 3 weeks ago

bjosttveit commented 3 weeks ago

Description

Added a new method called getDataModelUrl instead of using getDataElementUrl for stateful apps. The difference being that the former has the includeRowIds and the latter has language as before. The reason for not including the language in the data model urls is that we store the url in formDataWrite to be able to check in tanstack whether or not we are currently saving, and we do not want the language to be included in the cache key. The current language is now therefore added only right before the patch request gets sent. I added a utility function for adding the query-parameter in a way where it does not matter if it already has any parameters set, to avoid checking if ? or & should be used etc.

Related Issue(s)

Verification/QA

sonarcloud[bot] commented 3 weeks ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
93.8% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud