-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UIREQMED-3: Add Search field for Mediated requests activity page
- Loading branch information
1 parent
dc33e6f
commit 2ffaedd
Showing
5 changed files
with
46 additions
and
30 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 useGeneralTlrSettings } from './useGeneralTlrSettings'; |
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,33 @@ | ||
import { useQuery } from 'react-query'; | ||
Check failure on line 1 in src/hooks/useGeneralTlrSettings.js GitHub Actions / build-npm
|
||
|
||
import { useNamespace, useOkapiKy } from '@folio/stripes/core'; | ||
|
||
const SETTINGS_SCOPES = { | ||
CIRCULATION: 'circulation', | ||
}; | ||
const SETTINGS_KEYS = { | ||
GENERAL_TLR: 'generalTlr', | ||
}; | ||
|
||
const useGeneralTlrSettings = () => { | ||
const ky = useOkapiKy(); | ||
const [namespace] = useNamespace({ key: 'generalTlrSettings' }); | ||
const searchParams = { | ||
query: `(scope==${SETTINGS_SCOPES.CIRCULATION} and key==${SETTINGS_KEYS.GENERAL_TLR})`, | ||
}; | ||
|
||
const { isLoading, data, refetch, isFetching } = useQuery( | ||
[namespace], | ||
() => ky.get('settings/entries', { searchParams }).json(), | ||
{ enabled: true }, | ||
); | ||
|
||
return ({ | ||
isLoading, | ||
isFetching, | ||
data, | ||
refetch, | ||
}); | ||
}; | ||
|
||
export default useGeneralTlrSettings; |
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