-
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 branch 'master' into UITEN-281
- Loading branch information
Showing
101 changed files
with
3,044 additions
and
3,519 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { useNamespace, useOkapiKy } from '@folio/stripes/core'; | ||
import { useQuery } from 'react-query'; | ||
|
||
export const CAMPUS_DETAILS = 'CAMPUS_DETAILS'; | ||
|
||
export const useCampusDetails = ({ id, searchParams }) => { | ||
const ky = useOkapiKy(); | ||
const [namespaceKey] = useNamespace({ key: CAMPUS_DETAILS }); | ||
|
||
const { data, isLoading: isCampusLoading } = useQuery({ | ||
queryKey: [CAMPUS_DETAILS, namespaceKey, id, searchParams], | ||
queryFn: () => ky.get(`location-units/campuses/${id}`, { searchParams }).json(), | ||
enabled: !!id, | ||
}); | ||
|
||
return { | ||
campus: data, | ||
isCampusLoading, | ||
}; | ||
}; |
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,19 @@ | ||
import { useNamespace, useOkapiKy } from '@folio/stripes/core'; | ||
import { useQuery } from 'react-query'; | ||
|
||
export const CAMPUSES = 'CAMPUSES'; | ||
|
||
export const useCampuses = ({ searchParams }) => { | ||
const ky = useOkapiKy(); | ||
const [namespaceKey] = useNamespace({ key: CAMPUSES }); | ||
|
||
const { data, isLoading: isCampusesLoading } = useQuery({ | ||
queryKey: [CAMPUSES, namespaceKey, searchParams], | ||
queryFn: () => ky.get('location-units/campuses', { searchParams }).json(), | ||
}); | ||
|
||
return { | ||
campuses: data?.loccamps || [], | ||
isCampusesLoading, | ||
}; | ||
}; |
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,19 @@ | ||
import { useNamespace, useOkapiKy } from '@folio/stripes/core'; | ||
import { useQuery } from 'react-query'; | ||
|
||
export const CONFIGURATIONS = 'CONFIGURATIONS'; | ||
|
||
export const useConfigurations = ({ searchParams }) => { | ||
const ky = useOkapiKy(); | ||
const [namespaceKey] = useNamespace({ key: CONFIGURATIONS }); | ||
|
||
const { data, isLoading: isConfigsLoading } = useQuery({ | ||
queryKey: [CONFIGURATIONS, namespaceKey, searchParams], | ||
queryFn: () => ky.get('configurations/entries', { searchParams }).json(), | ||
}); | ||
|
||
return { | ||
configs: data?.configs || [], | ||
isConfigsLoading, | ||
}; | ||
}; |
Oops, something went wrong.