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

ENH Join endpoint path segments #173

Merged
merged 1 commit into from
Jan 16, 2024

Conversation

emteknetnz
Copy link
Member

Issue #165

@@ -114,7 +113,7 @@ const LinkField = ({
* Update the component when the 'Delete' button in the LinkPicker is clicked
*/
const onDelete = (linkID) => {
let endpoint = `${Config.getSection(section).form.linkForm.deleteUrl}/${linkID}`;
let endpoint = joinUrlPaths(Config.getSection(section).form.linkForm.deleteUrl, linkID.toString());
Copy link
Member Author

Choose a reason for hiding this comment

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

Need to convert the linkID int to a string otherwise joinURLPaths gets a weird array created when you pass in a string then an int 0 as arguments

Copy link
Member

@GuySartorelli GuySartorelli left a comment

Choose a reason for hiding this comment

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

Looks good, works well locally with both trailing slash config values. Can't find any that were missed.

@GuySartorelli GuySartorelli merged commit f18b830 into silverstripe:4 Jan 16, 2024
10 checks passed
@GuySartorelli GuySartorelli deleted the pulls/4/join-links branch January 16, 2024 03:11
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.

2 participants