Code styling changes
This commit is contained in:
@ -1,9 +1,9 @@
|
||||
import { LatLng } from "leaflet"
|
||||
import { LatLng } from 'leaflet'
|
||||
|
||||
import { API_URL } from "../../config"
|
||||
import { isArrayOf, isObject } from "../../utils/types"
|
||||
import useFetch from "./useFetch"
|
||||
import { isString } from "../../utils/types"
|
||||
import { API_URL } from '../../config'
|
||||
import { isArrayOf, isObject } from '../../utils/types'
|
||||
import useFetch from './useFetch'
|
||||
import { isString } from '../../utils/types'
|
||||
|
||||
type Trashbox = {
|
||||
Lat: number,
|
||||
@ -13,15 +13,15 @@ type Trashbox = {
|
||||
}
|
||||
|
||||
const isTrashbox = (obj: unknown): obj is Trashbox => isObject(obj, {
|
||||
"Lat": "number",
|
||||
"Lng": "number",
|
||||
"Address": "string",
|
||||
"Categories": obj => isArrayOf<string>(obj, isString)
|
||||
'Lat': 'number',
|
||||
'Lng': 'number',
|
||||
'Address': 'string',
|
||||
'Categories': obj => isArrayOf<string>(obj, isString)
|
||||
})
|
||||
|
||||
const useTrashboxes = (position: LatLng) => {
|
||||
return useFetch(
|
||||
API_URL + "/trashbox?" + new URLSearchParams({
|
||||
API_URL + '/trashbox?' + new URLSearchParams({
|
||||
lat: position.lat.toString(),
|
||||
lng: position.lng.toString()
|
||||
}).toString(),
|
||||
@ -32,4 +32,4 @@ const useTrashboxes = (position: LatLng) => {
|
||||
}
|
||||
|
||||
export type { Trashbox }
|
||||
export default useTrashboxes
|
||||
export default useTrashboxes
|
||||
|
Reference in New Issue
Block a user