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

Updating Users is Broken #10

Open
genio opened this issue Aug 31, 2021 · 0 comments
Open

Updating Users is Broken #10

genio opened this issue Aug 31, 2021 · 0 comments

Comments

@genio
Copy link

genio commented Aug 31, 2021

When updating a user, it fails because the Id field is being stripped here:
https://github.com/Trifoia/litmos-sdk/blob/master/lib/endpoints/users.js#L105-L107

According to the API docs, the user Id in the URL and the user Id in the XML payload must match. Since it's being stripped from the payload, we can't possibly update a user's information.

You can see where that stripping happens here:
https://github.com/Trifoia/litmos-sdk/blob/master/lib/generators/generate-user.js#L36

const res = await litmos.api.users.id(user.Id).put(user);

The above will fail because:

statusCode: 404,
statusMessage: 'Please check the userid in the xml/json and the userid in the URL. They must match.',
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

1 participant