From 6f70f40eecbfcba7d3149231ff8f16ca5c5121ae Mon Sep 17 00:00:00 2001 From: Eugene Dyudyunov Date: Fri, 29 Mar 2024 13:46:50 +0200 Subject: [PATCH] fix: internal routing ignores public path (#312) * fix: internal routing ignores public path Add a new util function for constructing the correct internal route URL. * test: add tests for createCorrectInternalRoute --- .../ProgramRecord/ProgramRecord.jsx | 3 +- .../ProgramRecordsList/ProgramRecordsList.jsx | 3 +- src/utils.js | 20 ++++++++ src/utils.test.js | 48 +++++++++++++++++++ 4 files changed, 72 insertions(+), 2 deletions(-) create mode 100644 src/utils.js create mode 100644 src/utils.test.js diff --git a/src/components/ProgramRecord/ProgramRecord.jsx b/src/components/ProgramRecord/ProgramRecord.jsx index 4a9069b..698aadb 100644 --- a/src/components/ProgramRecord/ProgramRecord.jsx +++ b/src/components/ProgramRecord/ProgramRecord.jsx @@ -21,6 +21,7 @@ import ProgramRecordTable from './ProgramRecordTable'; import RecordsHelp from './RecordsHelp'; import ProgramRecordAlert from '../ProgramRecordAlert'; import SendLearnerRecordModal from '../ProgramRecordSendModal'; +import createCorrectInternalRoute from '../../utils'; import getProgramDetails from './data/service'; @@ -81,7 +82,7 @@ function ProgramRecord({ isPublic }) { className="back-to-records" >