Skip to content

Commit

Permalink
Merge pull request #224 from KenEucker/develop
Browse files Browse the repository at this point in the history
Fixes missing search params in GET request
  • Loading branch information
KenEucker committed Jan 29, 2024
2 parents b1cf2c6 + 28c83ac commit 5ae95be
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/gallery/searchGallery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,13 @@ export async function searchGallery(
client: ImgurClient,
options: SearchGalleryOptions
): Promise<ImgurApiResponse<GalleryData>> {
const { pathname } = constructSearchGalleryUrl(options);
const { pathname, search } = constructSearchGalleryUrl(options);
// since we're using prefixUrl with got, we have to remove the starting slash or it'll throw
const finalPathname = pathname.slice(1);

return getImgurApiResponseFromResponse(
await client.request({ url: finalPathname }).catch((e) => e.response)
await client
.request({ url: finalPathname + search })
.catch((e) => e.response)
) as ImgurApiResponse<GalleryData>;
}

0 comments on commit 5ae95be

Please sign in to comment.