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

UIIN-2634: Set tenant from stripes.okapi.tenant if location.state is empty (follow-up) #2323

Merged
merged 10 commits into from
Oct 31, 2023
18 changes: 16 additions & 2 deletions src/ViewHoldingsRecord.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,14 @@ class ViewHoldingsRecord extends React.Component {
path: 'holdings-storage/holdings/:{holdingsrecordid}',
resourceShouldRefresh: false,
accumulate: true,
tenant: '!{location.state.tenantTo}'
tenant: (_q, _p, _r, _l, props) => {
const {
stripes,
location,
} = props;

return location?.state?.tenantTo || stripes.okapi.tenant;
OleksandrHladchenko1 marked this conversation as resolved.
Show resolved Hide resolved
},
},
items: {
type: 'okapi',
Expand All @@ -97,7 +104,14 @@ class ViewHoldingsRecord extends React.Component {
type: 'okapi',
path: 'inventory/instances/:{id}',
accumulate: true,
tenant: '!{location.state.tenantTo}'
tenant: (_q, _p, _r, _l, props) => {
const {
stripes,
location,
} = props;

return location?.state?.tenantTo || stripes.okapi.tenant;
},
},
tagSettings: {
type: 'okapi',
Expand Down
18 changes: 16 additions & 2 deletions src/routes/ItemRoute.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,14 @@ class ItemRoute extends React.Component {
path: 'inventory/items/:{itemid}',
POST: { path: 'inventory/items' },
resourceShouldRefresh: true,
tenant: '!{location.state.tenantTo}',
tenant: (_q, _p, _r, _l, props) => {
const {
stripes,
location,
} = props;

return location?.state?.tenantTo || stripes.okapi.tenant;
},
},
markItemAsWithdrawn: {
type: 'okapi',
Expand Down Expand Up @@ -101,7 +108,14 @@ class ItemRoute extends React.Component {
holdingsRecords: {
type: 'okapi',
path: 'holdings-storage/holdings/:{holdingsrecordid}',
tenant: '!{location.state.tenantTo}',
tenant: (_q, _p, _r, _l, props) => {
const {
stripes,
location,
} = props;

return location?.state?.tenantTo || stripes.okapi.tenant;
},
},
instanceRecords: {
type: 'okapi',
Expand Down
Loading