Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SD-127] fixed getTaxonomy only getting first 50 pages #1284

Merged
merged 1 commit into from
Aug 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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