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)
closes #2037
Verification/QA
Manual functionality testing
[x] I have tested these changes manually
[ ] Creator of the original issue (or service owner) has been contacted for manual testing (or will be contacted when released in alpha)
[ ] No testing done/necessary
Automated tests
[x] Unit test(s) have been added/updated
[ ] Cypress E2E test(s) have been added/updated
[ ] No automatic tests are needed here (no functional changes/additions)
Description
Added a new method called
getDataModelUrl
instead of usinggetDataElementUrl
for stateful apps. The difference being that the former has theincludeRowIds
and the latter haslanguage
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
kind/*
label to this PR for proper release notes grouping