diff --git a/src/utils/hooks/useRedirection.js b/src/utils/hooks/useRedirection.js index d0e5c22..741ef8b 100644 --- a/src/utils/hooks/useRedirection.js +++ b/src/utils/hooks/useRedirection.js @@ -10,7 +10,8 @@ const useRedirection = () => { const { locale, calendar, redirectionMode } = widgetProps; const handleRedirection = ({ id, type = urlTypes.EVENT }) => { - const url = getRedirectionUrl(id, type, locale, calendar); + const url = getRedirectionUrl({ id, type, locale, calendar }); + if (redirectionMode === redirectionModes.EXTERNAL) { redirectionHandler({ url }); } else { diff --git a/src/utils/redirectionHandler.js b/src/utils/redirectionHandler.js index e5dac52..7f527f0 100644 --- a/src/utils/redirectionHandler.js +++ b/src/utils/redirectionHandler.js @@ -4,7 +4,7 @@ export const redirectionHandler = ({ url }) => { export const getRedirectionUrl = ({ id, type = 'searchEventsUrl', calendar, locale }) => { if ('eventUrl' === type) - return `${process.env.REACT_APP_API_URL}${type}/${id}?calendar=${calendar}&locale=${locale}`; + return `${process.env.REACT_APP_API_URL}resource/${id}?calendar=${calendar}&locale=${locale}`; return `${process.env.REACT_APP_API_URL}calendars/${calendar}/events/redirect?locale=${locale}`; };