diff --git a/api/src/profile/application/attestation-controller.js b/api/src/profile/application/attestation-controller.js index fe3821086ef..a9454af52c6 100644 --- a/api/src/profile/application/attestation-controller.js +++ b/api/src/profile/application/attestation-controller.js @@ -2,6 +2,7 @@ import * as path from 'node:path'; import * as url from 'node:url'; import * as requestResponseUtils from '../../../src/shared/infrastructure/utils/request-response-utils.js'; +import { LOCALE } from '../../shared/domain/constants.js'; import { usecases } from '../domain/usecases/index.js'; import * as pdfWithFormSerializer from '../infrastructure/serializers/pdf/pdf-with-form-serializer.js'; @@ -9,8 +10,9 @@ const __dirname = url.fileURLToPath(new URL('.', import.meta.url)); const getUserAttestation = async function (request, h, dependencies = { pdfWithFormSerializer, requestResponseUtils }) { const userId = request.params.userId; - const locale = dependencies.requestResponseUtils.extractLocaleFromRequest(request); const attestationKey = request.params.attestationKey; + + const locale = LOCALE.FRENCH_FRANCE; const { data, templateName } = await usecases.getAttestationDataForUsers({ attestationKey, userIds: [userId], diff --git a/api/tests/profile/unit/application/attestation-controller_test.js b/api/tests/profile/unit/application/attestation-controller_test.js index ea0b1bfbaf4..7358f77d1c3 100644 --- a/api/tests/profile/unit/application/attestation-controller_test.js +++ b/api/tests/profile/unit/application/attestation-controller_test.js @@ -1,5 +1,6 @@ import { attestationController } from '../../../../src/profile/application/attestation-controller.js'; import { usecases } from '../../../../src/profile/domain/usecases/index.js'; +import { LOCALE } from '../../../../src/shared/domain/constants.js'; import * as requestResponseUtils from '../../../../src/shared/infrastructure/utils/request-response-utils.js'; import { expect, hFake, sinon } from '../../../test-helper.js'; @@ -10,7 +11,7 @@ describe('Profile | Unit | Controller | attestation-controller', function () { const pdfWithFormSerializerStub = { serialize: sinon.stub() }; sinon.stub(usecases, 'getAttestationDataForUsers'); const userId = '12'; - const locale = 'fr'; + const locale = LOCALE.FRENCH_FRANCE; const attestationKey = 'key'; const request = {