-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UIBULKED-349 Update Electronic access - URL relationship
- Loading branch information
Showing
9 changed files
with
119 additions
and
7 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { useOkapiKy } from '@folio/stripes/core'; | ||
import { useQuery } from 'react-query'; | ||
|
||
export const useElectronicAccessRelationships = (options = {}) => { | ||
const ky = useOkapiKy(); | ||
|
||
const { data, isLoading: isElectronicAccessLoading } = useQuery( | ||
{ | ||
queryKey: 'electronicAccess', | ||
cacheTime: Infinity, | ||
staleTime: Infinity, | ||
queryFn: () => ky.get('electronic-access-relationships').json(), | ||
...options, | ||
}, | ||
); | ||
|
||
const electronicAccessRelationships = data?.electronicAccessRelationships?.map((item) => ({ | ||
label: item.name, | ||
value: item.id, | ||
})) || []; | ||
|
||
return { | ||
electronicAccessRelationships, | ||
isElectronicAccessLoading, | ||
}; | ||
}; |
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