-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #417 from folio-org/UITEN-292
UITEN-292: Change visibility rules for routing service points
- Loading branch information
Showing
11 changed files
with
108 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default as useCirculationSettingsEcsTlrFeature } from './useCirculationSettingsEcsTlrFeature'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default } from './useCirculationSettingsEcsTlrFeature'; |
27 changes: 27 additions & 0 deletions
27
src/hooks/useCirculationSettingsEcsTlrFeature/useCirculationSettingsEcsTlrFeature.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { useQuery } from 'react-query'; | ||
|
||
import { useNamespace, useOkapiKy } from '@folio/stripes/core'; | ||
|
||
import { getEcsTlrFeature } from '../../settings/ServicePoints/utils'; | ||
|
||
const useCirculationSettingsEcsTlrFeature = (enabled) => { | ||
const ky = useOkapiKy(); | ||
const [namespace] = useNamespace({ key: 'circulationSettingsEcsTlrFeature' }); | ||
const searchParams = { | ||
query: 'name==ecsTlrFeature', | ||
}; | ||
const { isLoading, data, refetch, isFetching } = useQuery( | ||
[namespace], | ||
() => ky.get('circulation/settings', { searchParams }).json(), | ||
{ enabled }, | ||
); | ||
|
||
return ({ | ||
titleLevelRequestsFeatureEnabled: getEcsTlrFeature(data?.circulationSettings), | ||
isLoading, | ||
isFetching, | ||
refetch, | ||
}); | ||
}; | ||
|
||
export default useCirculationSettingsEcsTlrFeature; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.