Problem/Motivation
There should be a way to ensure that the API endpoint actually points to the real Drupal endpoint, it currently relies on the current location which might not always be correct.
Letting Drupal.url() generate it allows sites to better control how the URL is constructed.
Steps to reproduce
Have a site with a custom drupalSettings.path.baseUrl that is already an absolute URL, then the endpoint URL no longer works.
Proposed resolution
Rely on Drupal.url() to handle the URL resolving.
Remaining tasks
Provide issue fork.
User interface changes
N/A
Issue fork sitewide_alert-3524126
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3524126-use-drupal.url-for
changes, plain diff MR !69
- 3524126-use-drupal-url
changes, plain diff MR !70
Comments
Comment #4
codebymikey commentedComment #8
smustgrave commentedI'm fine with this change.