-
Notifications
You must be signed in to change notification settings - Fork 39
Open
Description
Hi there, when using google places api you have to deal with url like https://places.googleapis.com/v1/places:searchNearby
so when if you try to do
const $fetch = createFetch({
baseURL: 'https://places.googleapis.com',
headers: {
'content-type': 'application/json',
accept: 'application/json',
'X-Goog-Api-Key': env.NEXT_PUBLIC_GOOGLE_MAPS_API_KEY,
'X-Goog-FieldMask': ['places.id', 'places.displayName', ....].join(','),
},
schema: createSchema({
'/v1/places:searchNearby': {
method: 'post',
input: z.object({ xxx }),
},
}),
})
const { data, error } = await $fetch('/v1/places:searchNearby', {xxx})then you got an error telling me that the params :searchNearby is missing.
Argument of type '{ body: {}; }' is not assignable to parameter of type '{ cache?: RequestCache | undefined; credentials?: RequestCredentials | undefined; headers?: (HeadersInit & (HeadersInit | CommonHeaders)) | undefined; ... 32 more ...; disableValidation?: boolean | undefined; }'.
Property 'params' is missing in type '{ body: {}; }' but required in type '{ cache?: RequestCache | undefined; credentials?: RequestCredentials | undefined; headers?: (HeadersInit & (HeadersInit | CommonHeaders)) | undefined; ... 32 more ...; disableValidation?: boolean | undefined; }'.
Metadata
Metadata
Assignees
Labels
No labels