Code styling changes

This commit is contained in:
2023-07-13 18:38:31 +03:00
parent 9437c44054
commit 7b0ccc525c
33 changed files with 358 additions and 387 deletions

View File

@ -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