You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A common use case for this is e.g. that you want to calculate statistics over a given set of realizations, and then when the backend does the calculation, it discovers that for the data type in question + set of realizations, some of them are missing the necessary data.
In some cases, it would be preferred to calculate statistics over the realizations that do have data, and at the same time communicate to the user which realizations where forced to be removed from the calculation.
The text was updated successfully, but these errors were encountered:
We somehow need to add the warning to either the header or the response. Do we change the way we return data from our endpoints to a function taking the actual response data + potential warnings/errors and creates a unified response? What are alternatives?
Consuming the responses frontend
How can we intercept the warnings/errors coming from backend in a HTTP response in an automated manner? We need access to:
The response body and potentially the header (depending on the means of transportation)
The module instance id
We want the HTTP response as an input and the actual response data and warning as two separate outputs. The former gets send to the module that made the request, the second one is passed automatically to the module instance.
Where do we (need to) intercept?
Axios - difficult as all functions are auto-generated
Tanstack Query - has no access to the header information and is very close to the actual module implementation level
An optional wrapper around the @api calls in useQuery calls that do the separation for us - would require the module instance id
A common use case for this is e.g. that you want to calculate statistics over a given set of realizations, and then when the backend does the calculation, it discovers that for the data type in question + set of realizations, some of them are missing the necessary data.
In some cases, it would be preferred to calculate statistics over the realizations that do have data, and at the same time communicate to the user which realizations where forced to be removed from the calculation.
The text was updated successfully, but these errors were encountered: