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

Unable to call Alma::User.find without sending "expand" params in the call #87

Closed
sandbergja opened this issue Jan 9, 2023 · 0 comments · Fixed by #88
Closed

Unable to call Alma::User.find without sending "expand" params in the call #87

sandbergja opened this issue Jan 9, 2023 · 0 comments · Fixed by #88

Comments

@sandbergja
Copy link
Contributor

When you call Alma::User.find('my_awesome_user'), it sends an HTTP request to https://[alma_url]/my_awesome_user?expand=fees,requests,loans.

If you don't want, say, fees, you can pass in a custom expand param with Alma::User.find('my_awesome_user', expand: 'requests,loans')

However, if you don't want any of these expansions, this method doesn't have an option to send the request to just regular https://[alma_url]/my_awesome_user.

Background and use case

We ran into a bug in the Alma API (mentioned here: https://code4lib.slack.com/archives/C0B3ELJQM/p1673289416145099) that caused an error status to be returned in certain cases when fees was expanded. In exploring the issue, we found that our app didn't actually need fees, requests or loans info.

We can still do our own "unexpanded" http request and pass it to Alma::User.new, but being able to send an "unexpanded" request with #find would be a nice convenience.

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

Successfully merging a pull request may close this issue.

1 participant