Skip to content

Commit

Permalink
Merge branch 'main' into feature-spend-for-additional-time-token-option
Browse files Browse the repository at this point in the history
  • Loading branch information
epsilonError committed Oct 21, 2024
2 parents 2f7d06e + 0bfa47d commit 26da447
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/app/services/question-pro.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ export class QuestionProService {
#userId?: string;
#apiKey?: string;

static readonly PER_PAGE_MAX = 1000;
perPage?: number = 950; // TODO: Improve this band aid fix, so we handle 413 errors in Paginated Requests

private participationCache: Map<string, Map<string, Set<string>>> = new Map<string, Map<string, Set<string>>>();

constructor(@Inject(AxiosService) private axiosService: AxiosService) {}
Expand Down Expand Up @@ -97,7 +100,7 @@ export class QuestionProService {
return new QuestionProPaginatedResult(
await this.#rawAPIRequest(`/users/${this.#userId}/surveys`, {
params: {
perPage: 1000,
perPage: QuestionProService.PER_PAGE_MAX,
page: 1
}
}),
Expand Down Expand Up @@ -156,7 +159,7 @@ export class QuestionProService {
return new QuestionProPaginatedResult(
await this.#rawAPIRequest(`/surveys/${surveyId}/questions`, {
params: {
perPage: 1000,
perPage: QuestionProService.PER_PAGE_MAX,
page: 1
}
}),
Expand Down Expand Up @@ -185,7 +188,7 @@ export class QuestionProService {
return new QuestionProPaginatedResult(
await this.#rawAPIRequest(`/surveys/${surveyId}/responses`, {
params: {
perPage: 1000,
perPage: this.perPage ?? QuestionProService.PER_PAGE_MAX,
page: 1
}
}),
Expand Down

0 comments on commit 26da447

Please sign in to comment.