Open saimirg opened 7 years ago
Hi
I have small hack for this, using the addFullRequestInterceptor, but I wish we had a better solution.
So for your case it would be something like:
RestangularProvider.addFullRequestInterceptor(function(element, operation, what, url, headers, params) {
if (operation == 'getList') {
//WARN: intercept only for specific view
if (what === 'LoginData') {
const hash = location.hash;
if (hash.includes('Subscriptions/create')) {
const search = 'defaultValues=';
const defaultValuesStr = decodeURIComponent(hash.substring(hash.indexOf(search) + search.length));
const defaultValues = JSON.parse(defaultValuesStr);
params['login_id'] = defaultValues.login_id;
}
}
}
return {
params: params
};
});
Hi, i read that i should ask on StackOverflow and Gitter and some time ago I published the same question on both but got no answer.
Here is my question: The following link is clicked at some point during the workflow to add a subscription record. http://example.com/admin/#/Subscriptions/create?defaultValues={"login_id":1234}
This is part of the creationView code:
...which when loads, calls the API to the LoginData entity. Our problem is that the response is bringing back all the records and we're not finding a way to pass the _loginid parameter as query parameter so we can filter records on the backend; (or as a permanent filter ?)
So API to LoginData should call http://example.com/api/LoginData?login_id=1234