Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove relation throws exception #80

Closed
cychiuae opened this issue Sep 29, 2016 · 0 comments
Closed

Remove relation throws exception #80

cychiuae opened this issue Sep 29, 2016 · 0 comments
Assignees

Comments

@cychiuae
Copy link
Contributor

cychiuae commented Sep 29, 2016

Follow the example in Skygear JS SDK documentation.

const unFollow = new skygear.relation.Follower([ben]);
skygear.relation.remove(unFollow).then((result) => {
  console.log(result.success); // Return an array of user, here is [ben]
}, (error) => {
  console.error(error);
});

It will throw an exception, TypeError: Cannot read property 'user_id' of undefined.

This exception is due to the fact that JS SDK expects Skygear server returns a list of users whose relation is successfully removed in result.data. However, the server does not return that field currently.

  • Skygear SDK Date/Version: 0.17.0
  • Skygear Server Date/Version: 0.17.0

Expected Results

No exception when removing a relation

Actual Results

Throw an exeception

@rickmak rickmak changed the title Remove relation throws exception Remove relation throws exception Sep 30, 2016
@rickmak rickmak self-assigned this Sep 30, 2016
rickmak added a commit to rickmak/skygear-SDK-JS that referenced this issue Oct 28, 2016
rickmak added a commit to rickmak/skygear-doc that referenced this issue Oct 28, 2016
@royuen royuen closed this as completed Oct 31, 2016
bensonby pushed a commit to SkygearIO/skygear-doc that referenced this issue Nov 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants