diff --git a/api/src/shared/application/usecases/checkUserBelongsToLearnersOrganization.js b/api/src/shared/application/usecases/checkUserBelongsToLearnersOrganization.js index f70bd90414f..bfabb37caaa 100644 --- a/api/src/shared/application/usecases/checkUserBelongsToLearnersOrganization.js +++ b/api/src/shared/application/usecases/checkUserBelongsToLearnersOrganization.js @@ -1,6 +1,6 @@ import _ from 'lodash'; -import * as organizationLearnerRepository from '../../../../lib/infrastructure/repositories/organization-learner-repository.js'; +import * as organizationLearnerRepository from '../../../../src/prescription/learner-management/infrastructure/repositories/organization-learner-repository.js'; import * as membershipRepository from '../../../team/infrastructure/repositories/membership.repository.js'; const execute = async function ( @@ -8,7 +8,7 @@ const execute = async function ( organizationLearnerId, dependencies = { membershipRepository, organizationLearnerRepository }, ) { - const organizationLearner = await dependencies.organizationLearnerRepository.get(organizationLearnerId); + const organizationLearner = await dependencies.organizationLearnerRepository.getLearnerInfo(organizationLearnerId); const memberships = await dependencies.membershipRepository.findByUserIdAndOrganizationId({ userId, organizationId: organizationLearner.organizationId, diff --git a/api/tests/shared/unit/application/usecases/checkUserBelongsToLearnersOrganization_test.js b/api/tests/shared/unit/application/usecases/checkUserBelongsToLearnersOrganization_test.js index f9d80cb1afe..836c4c3bf5b 100644 --- a/api/tests/shared/unit/application/usecases/checkUserBelongsToLearnersOrganization_test.js +++ b/api/tests/shared/unit/application/usecases/checkUserBelongsToLearnersOrganization_test.js @@ -10,7 +10,7 @@ describe('Unit | Application | Use Case | checkUserBelongsToLearnersOrganization findByUserIdAndOrganizationId: sinon.stub(), }; organizationLearnerRepositoryStub = { - get: sinon.stub(), + getLearnerInfo: sinon.stub(), }; }); @@ -26,7 +26,7 @@ describe('Unit | Application | Use Case | checkUserBelongsToLearnersOrganization id: organizationLearnerId, organization: sharedOrganization, }); - organizationLearnerRepositoryStub.get.resolves(organizationLearner); + organizationLearnerRepositoryStub.getLearnerInfo.resolves(organizationLearner); membershipRepositoryStub.findByUserIdAndOrganizationId.resolves([membership]); // when @@ -54,7 +54,7 @@ describe('Unit | Application | Use Case | checkUserBelongsToLearnersOrganization id: organizationLearnerId, anotherOrganization, }); - organizationLearnerRepositoryStub.get.resolves(organizationLearner); + organizationLearnerRepositoryStub.getLearnerInfo.resolves(organizationLearner); membershipRepositoryStub.findByUserIdAndOrganizationId.resolves([]); // when