Skip to content

Commit 135af9d

Browse files
fix: fix event links with double locale, e.g. /fi/fi/ -> /fi/
also: - remove unnecessary string interpolations refs PT-1725
1 parent fc85aea commit 135af9d

7 files changed

Lines changed: 10 additions & 18 deletions

File tree

src/domain/event/EditEventPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ const useEventFormEditSubmit = (
5959
);
6060

6161
const goToOccurrencesPage = () => {
62-
id && pushWithLocale(`${ROUTES.CREATE_OCCURRENCE.replace(':id', id)}`);
62+
id && pushWithLocale(ROUTES.CREATE_OCCURRENCE.replace(':id', id));
6363
};
6464

6565
const navigateAfterSave = () => {

src/domain/event/EventDetailsPage.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,7 @@ const EventDetailsPage = () => {
149149
};
150150

151151
const handleEditEventClick = () => {
152-
id &&
153-
pushWithReturnPath(`/${locale}${ROUTES.EDIT_EVENT.replace(':id', id)}`);
152+
id && pushWithReturnPath(ROUTES.EDIT_EVENT.replace(':id', id));
154153
};
155154

156155
return (

src/domain/event/EventPreviewPage.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ const EventPage: React.FC = () => {
3131
getEventFields(eventData?.event, locale);
3232

3333
const goToSummaryPage = () => {
34-
eventId &&
35-
pushWithLocale(`${ROUTES.EVENT_SUMMARY}`.replace(':id', eventId));
34+
eventId && pushWithLocale(ROUTES.EVENT_SUMMARY.replace(':id', eventId));
3635
};
3736

3837
return (

src/domain/event/EventSummaryPage.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,18 +99,15 @@ const EventSummaryPage: React.FC = () => {
9999
};
100100

101101
const goToEventDetailsPage = () => {
102-
eventId &&
103-
pushWithReturnPath(`${ROUTES.EVENT_DETAILS.replace(':id', eventId)}`);
102+
eventId && pushWithReturnPath(ROUTES.EVENT_DETAILS.replace(':id', eventId));
104103
};
105104

106105
const goToCreateOccurrence = () => {
107-
eventId &&
108-
pushWithLocale(`${ROUTES.CREATE_OCCURRENCE.replace(':id', eventId)}`);
106+
eventId && pushWithLocale(ROUTES.CREATE_OCCURRENCE.replace(':id', eventId));
109107
};
110108

111109
const copyEventToNewTemplate = () => {
112-
eventId &&
113-
pushWithReturnPath(`${ROUTES.COPY_EVENT.replace(':id', eventId)}`);
110+
eventId && pushWithReturnPath(ROUTES.COPY_EVENT.replace(':id', eventId));
114111
};
115112

116113
const goToHome = () => pushWithLocale(ROUTES.HOME);

src/domain/occurrence/CreateOccurrencePage.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,7 @@ const CreateOccurrencePage: React.FC = () => {
222222
};
223223

224224
const goToSummaryPage = () => {
225-
eventId &&
226-
pushWithLocale(`${ROUTES.EVENT_SUMMARY}`.replace(':id', eventId));
225+
eventId && pushWithLocale(ROUTES.EVENT_SUMMARY.replace(':id', eventId));
227226
};
228227

229228
const handleSelectedLanguagesChange = (

src/domain/occurrence/enrolmentDetails/EnrolmentDetails.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,10 @@ const EnrolmentDetails: React.FC<EnrolmentDetailsProps> = ({
151151

152152
const handleEditEnrolment = () => {
153153
pushWithReturnPath(
154-
`${ROUTES.EDIT_ENROLMENT.replace(':eventId', eventId).replace(
154+
ROUTES.EDIT_ENROLMENT.replace(':eventId', eventId).replace(
155155
':enrolmentId',
156156
enrolmentId
157-
)}`
157+
)
158158
);
159159
};
160160

src/domain/occurrence/occurrenceInfo/OccurrenceInfo.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,7 @@ const OccurrenceInfo: React.FC<Props> = ({ event, occurrence }) => {
4848
const placeId = occurrence.placeId || event.location?.id;
4949

5050
const goToEventDetailsPage = () => {
51-
pushWithReturnPath(
52-
`/${locale}${ROUTES.EVENT_DETAILS.replace(':id', eventId || '')}`
53-
);
51+
pushWithReturnPath(ROUTES.EVENT_DETAILS.replace(':id', eventId || ''));
5452
};
5553

5654
const getOccurrenceDateTimeString = () => {

0 commit comments

Comments
 (0)