import { LatLng } from 'leaflet'

import { API_URL } from '../../config'
import { Trashbox, TrashboxResponse } from './types'
import { Category } from '../../assets/category'

const composeTrashboxURL = (position: LatLng, category: Category) => (
    API_URL + '/trashbox?' + new URLSearchParams({
        lat: position.lat.toString(),
        lng: position.lng.toString(),
        category: category,
    }).toString()
)

const processTrashbox = (data: TrashboxResponse): Trashbox[] => (
    data
)

export { composeTrashboxURL, processTrashbox }
