mirror of
https://github.com/nowcommunity/nowdatabase.git
synced 2026-10-12 19:13:52 +03:00
17 lines
422 B
TypeScript
Executable File
17 lines
422 B
TypeScript
Executable File
import { api } from './api'
|
|
import { ParsedGeoname } from '../shared/types'
|
|
|
|
const geonamesApi = api.injectEndpoints({
|
|
endpoints: builder => ({
|
|
getGeonames: builder.query<{ locations: ParsedGeoname[] }, string>({
|
|
query: search => ({
|
|
url: `/geonames-api`,
|
|
method: 'POST',
|
|
body: { locationName: search },
|
|
}),
|
|
}),
|
|
}),
|
|
})
|
|
|
|
export const { useLazyGetGeonamesQuery } = geonamesApi
|