Skip to content

Commit

Permalink
feat: generate resultat sessions link
Browse files Browse the repository at this point in the history
Co-authored-by: Steph0 <[email protected]>
Co-authored-by: Andreia Pena <[email protected]>
  • Loading branch information
3 people committed Dec 4, 2024
1 parent 7a83571 commit ff0054f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion api/lib/domain/services/session-results-link-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const generateResultsLink = function ({ sessionId, i18n }) {

const token = tokenService.createCertificationResultsLinkToken({ sessionId, daysBeforeExpiration });
const lang = i18n.getLocale();
const link = `${config.domain.pixApp + config.domain.tldOrg}/api/sessions/download-all-results/${token}?lang=${lang}`;
const link = `${config.domain.pixApp + config.domain.tldOrg}/resultats-session#${token}?lang=${lang}`;

return link;
};
Expand Down
1 change: 1 addition & 0 deletions api/src/shared/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,7 @@ const configuration = (function () {
config.domain.tldOrg = '.org';
config.domain.pix = 'https://pix';
config.domain.pixOrga = 'https://orga.pix';
config.domain.pixApp = 'https://test.app.pix';

config.features.dayBeforeRetrying = 4;
config.features.dayBeforeImproving = 4;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('Unit | Domain | Service | Session Results Link Service', function () {
const link = sessionResultsLinkService.generateResultsLink({ sessionId, i18n });

// then
expect(link).to.deep.equal('https://app.pix.org/api/sessions/download-all-results/a_valid_token?lang=fr');
expect(link).to.deep.equal('https://test.app.pix.org/resultats-session#a_valid_token?lang=fr');
});
});
});

0 comments on commit ff0054f

Please sign in to comment.