From 566a15ea200fcc505e97b07a121d5a0339f196a7 Mon Sep 17 00:00:00 2001 From: Guillaume Date: Thu, 30 Jan 2025 12:06:53 +0100 Subject: [PATCH] fix(api): add order constraint on organization share script --- api/src/profile/scripts/sixth-grade-organization-share.js | 2 +- .../integration/scripts/sixth-grade-organization-share_test.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/src/profile/scripts/sixth-grade-organization-share.js b/api/src/profile/scripts/sixth-grade-organization-share.js index 12d5b9146f7..0c68268158a 100644 --- a/api/src/profile/scripts/sixth-grade-organization-share.js +++ b/api/src/profile/scripts/sixth-grade-organization-share.js @@ -76,7 +76,7 @@ export class SixthGradeOrganizationShare extends Script { */ async fetchProfileRewards(limit, offset) { const knexConnection = DomainTransaction.getConnection(); - return await knexConnection('profile-rewards').select('userId', 'id').limit(limit).offset(offset); + return await knexConnection('profile-rewards').select('userId', 'id').limit(limit).offset(offset).orderBy('id'); } async fetchUserOrganizations(userId) { diff --git a/api/tests/profile/integration/scripts/sixth-grade-organization-share_test.js b/api/tests/profile/integration/scripts/sixth-grade-organization-share_test.js index da9a9ab9075..1d087f37791 100644 --- a/api/tests/profile/integration/scripts/sixth-grade-organization-share_test.js +++ b/api/tests/profile/integration/scripts/sixth-grade-organization-share_test.js @@ -27,7 +27,7 @@ describe('Integration | Profile | Scripts | sixth-grade-organization-share ', f databaseBuilder.factory.buildOrganizationLearner({ organizationId: firstOrganizationId, userId }), ); - // build an other organization learner for userId 3 + // build another organization learner for userId 3 databaseBuilder.factory.buildOrganizationLearner({ organizationId: secondOrganizationId, userId: 3 }); // build profile rewards