forked from polka_billy/porridger
@ -3,3 +3,4 @@ export { default as useBook } from './useBook'
|
||||
export { default as useAuth } from './useAuth'
|
||||
export { default as useTrashboxes } from './useTrashboxes'
|
||||
export { default as useAddAnnouncement } from './useAddAnnouncement'
|
||||
export { default as useOsmAddresses } from './useOsmAddress'
|
||||
|
17
front/src/hooks/api/useOsmAddress.ts
Normal file
17
front/src/hooks/api/useOsmAddress.ts
Normal file
@ -0,0 +1,17 @@
|
||||
import { LatLng } from 'leaflet'
|
||||
|
||||
import useFetch from './useFetch'
|
||||
import { composeOsmAddressURL, processOsmAddress } from '../../api/osmAddress'
|
||||
import { isOsmAddressResponse } from '../../api/osmAddress/types'
|
||||
|
||||
const useOsmAddresses = (addressPosition: LatLng) =>
|
||||
useFetch(
|
||||
composeOsmAddressURL(addressPosition),
|
||||
'GET',
|
||||
false,
|
||||
isOsmAddressResponse,
|
||||
processOsmAddress,
|
||||
''
|
||||
)
|
||||
|
||||
export default useOsmAddresses
|
Reference in New Issue
Block a user