Skip to content

Commit

Permalink
fix: explicitly sort subjects by ID
Browse files Browse the repository at this point in the history
Sort subjects by ID, otherwise the paged API query can duplicate subjects across pages.
  • Loading branch information
eatyourgreens authored Jul 9, 2024
1 parent 5dfd0cb commit 5914ff1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/subject-set.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ async function getPagedSubjects(subjectSet, page = 1) {
const { subjects, meta } = await fetchWithRetry('/subjects', {
subject_set_id: id,
page_size: PAGE_SIZE,
page
page,
sort_by: 'id'
})
const rows = subjects.map(subject => subjectMetadataRow(subject, indexFields))
if (meta.subjects.page_count > page) {
Expand Down

0 comments on commit 5914ff1

Please sign in to comment.