Skip to content

Commit

Permalink
fix(@dpc-sdp/ripple-tide-api): 🐛 fixed getTaxonomy only getting first…
Browse files Browse the repository at this point in the history
… 50 items
  • Loading branch information
jeffdowdle authored and dylankelly committed Aug 8, 2024
1 parent e6fea94 commit f46ed87
Showing 1 changed file with 5 additions and 17 deletions.
22 changes: 5 additions & 17 deletions packages/ripple-tide-api/src/services/tide-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -327,10 +327,10 @@ export default class TidePageApi extends TideApiBase {
async getEntityList(
entityType,
bundle,
filtering,
includes,
pagination,
sorting,
filtering?,
includes?,
pagination?,
sorting?,
{ allPages = true } = {}
) {
const params: Record<string, any> = {
Expand Down Expand Up @@ -442,20 +442,8 @@ export default class TidePageApi extends TideApiBase {
}

async getTaxonomy(taxonomyName: string) {
const params = {
site: this.site
}
try {
const { data: response } = await this.get(
`/taxonomy_term/${taxonomyName}`,
{
params
}
)
if (response) {
const resource = jsonapiParse.parse(response).data
return resource
}
return await this.getEntityList('taxonomy_term', taxonomyName)
} catch (error: any) {
throw new ApplicationError('Error fetching taxonomy', { cause: error })
}
Expand Down

0 comments on commit f46ed87

Please sign in to comment.