Solved
Problem adding relations in js
I've got a one to many relationship in my Users table called 'blocked', I add a relationship to it like so:
- Backendless.Data.of('Users').addRelation(this.props.currentUser, 'blocked', [this.state.user])
- .then(() => console.log('Relation set'))
- .catch(error => console.log(error));
Which adds the relation, and shows up fine on the backend but when I retrieve it, the objects are undefined instead of user objects for some reason. If I manually add a relation using the console, they're retrieved fine as user objects. Also, props on 4.0, its way better than 3 and the changes you made for stuff like relations are much appreciated.
Thanks, Mudasar.
the problem has been fixed and released, please upgrade JS-SDK to v4.2.2 and check it.
Let us know if it works for you.
Regards, Vlad
Hi Mudasar
is this "this.state.user" saved on the server before you try to add it as relation?
Leave a Comment
Comments have been locked on this page!