Skip to content

Commit

Permalink
Merge pull request #71 from culturecreates/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
sahalali authored Jan 24, 2025
2 parents 655bf49 + f7e227b commit a6d54b5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/utils/hooks/useRedirection.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/redirectionHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`;
};

0 comments on commit a6d54b5

Please sign in to comment.