Skip to content

Commit 9036e50

Browse files
committed
Allow 0 params
1 parent 23f561f commit 9036e50

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/methods/search/index.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ type SearchPhotosParams = SearchParams &
3333
export const getPhotos = (() => {
3434
const getPathname = () => `${SEARCH_PATH_PREFIX}/photos`;
3535
return makeEndpoint({
36-
getPathname,
36+
// Wrapper uses type trick to allow 0 args
37+
getPathname: (_params?: void) => getPathname(),
3738
handleRequest: createRequestHandler(
3839
({
3940
query,
@@ -64,7 +65,8 @@ export const getPhotos = (() => {
6465
export const getCollections = (() => {
6566
const getPathname = () => `${SEARCH_PATH_PREFIX}/collections`;
6667
return makeEndpoint({
67-
getPathname,
68+
// Wrapper uses type trick to allow 0 args
69+
getPathname: (_params?: void) => getPathname(),
6870
handleRequest: createRequestHandler(({ query, ...paginationParams }: SearchParams) => ({
6971
pathname: getPathname(),
7072
query: { query, ...Query.getFeedParams(paginationParams) },
@@ -76,7 +78,8 @@ export const getCollections = (() => {
7678
export const getUsers = (() => {
7779
const getPathname = () => `${SEARCH_PATH_PREFIX}/users`;
7880
return makeEndpoint({
79-
getPathname,
81+
// Wrapper uses type trick to allow 0 args
82+
getPathname: (_params?: void) => getPathname(),
8083
handleRequest: createRequestHandler(({ query, ...paginationParams }: SearchParams) => ({
8184
pathname: getPathname(),
8285
query: { query, ...Query.getFeedParams(paginationParams) },

0 commit comments

Comments
 (0)