Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Snippet generated wrong URL for the access to the 'rest/V1/swell/session/snippet' endpoint #37

Closed
bbakalov opened this issue Apr 22, 2022 · 3 comments

Comments

@bbakalov
Copy link

Environment details

Magento Commerce ver. 2.3.4 (Enterprise edition)


I stuck with a problem when this part of the code in the snippet generation file view/frontend/templates/snippet.phtml

storage.get(
                        url.build('rest/V1/swell/session/snippet')
                    ).done(function (response) {

called to the https://store.com/{cmsPageUrlKey}/rest/V1/swell/session/snippet instead of https://store.com/rest/V1/swell/session/snippet

It happened on the CMS page.

Expected result

Call API https://store.com/rest/V1/swell/session/snippet

Actual result

Call API https://store.com/{cmsPageUrlKey}/rest/V1/swell/session/snippet


It happened only on one website. I can't reproduce it on the other test server and my local project.

@bbakalov
Copy link
Author

I have already prepared a fix for this issue. You can check it in the pull request #38

@namnguyen1998
Copy link

namnguyen1998 commented May 21, 2022

I tried adding '/' before 'rest' and it worked fine.

storage.get(
url.build('/rest/V1/swell/session/snippet')
).done(function (response) {

@pniel-cohen
Copy link
Collaborator

@namnguyen1998,
This issue has been fixed almost a year ago.
Please make sure that you are using the latest module version and that you are not overriding snippet.phtml on your local theme.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants