-
Notifications
You must be signed in to change notification settings - Fork 18
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
UIIN-2811 Use consolidated locations endpoint to fetch all locations when in central tenant context. #2471
Conversation
…when in central tenant context.
const { data: consolidatedLocations } = useQuery({ | ||
queryKey: [namespace, 'consolidatedLocations'], | ||
queryFn: () => ky.get('search/consortium/locations').json(), | ||
enabled: Boolean(isUserInConsortiumMode(stripes) && isUserInCentralTenant), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why can't we use this endpoint on member tenants? This would improve performance (avoid sending 65 requests for 65 tenants for example) and also will allow us to display locations for Consortial holdings accordion for tenants with limited permissions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a limitation on back-end side unfortunately, the endpoint was implemented with this in mind
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we use similar endpoints on member tenants - useConsortiumHoldings and useConsortiumItems, but sending requests in the context of central tenant. Or are there some other limitations?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I misunderstood your question - useConsortiumHoldings
and useConsortiumItems
send requests when a user is in central tenant. Same with the locations endpoint. We only use it when user is in central tenant. If it's a member tenant then we should send multiple requests to a regular /locations
endpoint
I think it's the same limitation as for holdings and items - user in a member tenant may not have permissions in central or other tenants to fetch locations from other tenants
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a situation where we have an admin from a member tenant who is affiliated with all other tenants in the consortia?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no-no, useConsortiumHoldings
and useConsortiumItems
are also sent from member tenants but in the context of the central tenant (x-okapi-tenant: central). 1 difference here is that they are sent only with the condition that a particular member tenant does not have permission to get holdings/items from inventory storage. You can find more here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This endpoint still requires central tenant permissions, and in our case we want users without central tenant permissions to fetch locations from other tenants.
|
Description
Use consolidated locations endpoint to fetch all locations when in central tenant context.
Screenshots
chrome_CyucJPIggv.mp4
Issues
UIIN-2811