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

Include SCRIPT_ROOT in URL creattion w JS #76

Merged
merged 1 commit into from
Oct 16, 2023

Conversation

mhkc
Copy link
Contributor

@mhkc mhkc commented Oct 16, 2023

This PR fixes issues with resolving valid URLs if Bonsai is hosted in a subpath.

Close #74

@mhkc mhkc requested a review from alkc October 16, 2023 09:56
@mhkc mhkc linked an issue Oct 16, 2023 that may be closed by this pull request
@@ -42,7 +43,8 @@
const body = {
remove_all: true
}
fetch(`${window.origin}/api/basket/remove`, {
const baseUrl = {{ request.script_root|tojson }}
fetch(`${baseUrl}/api/basket/remove`, {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good thing we put the actual api at lennart:80/bonsai/api/v1 rather than just lennart:80/bonsai/api/, otherwise all client api calls like this one would be directed by apache to the actual api.

Copy link
Contributor

@alkc alkc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tested the code on the lennart build and confirmed that it resolves the issues w/ broken sample basket and sample links.

@alkc
Copy link
Contributor

alkc commented Oct 16, 2023

I've also confirmed that the code does not break dev instances of bonsai

@alkc alkc merged commit 2600206 into master Oct 16, 2023
1 check failed
@mhkc mhkc deleted the 74-sample-table-links-unaware-of-subpath branch October 20, 2023 09:18
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

Successfully merging this pull request may close these issues.

Sample table links unaware of subpath
2 participants