Skip to content

Added URL Argument to Call method#239

Closed
FeezyHendrix wants to merge 2 commits intofrappe:mainfrom
FeezyHendrix:override-call-url
Closed

Added URL Argument to Call method#239
FeezyHendrix wants to merge 2 commits intofrappe:mainfrom
FeezyHendrix:override-call-url

Conversation

@FeezyHendrix
Copy link

Problem:
The current call method is limited to using a fixed base URL. It does not support sending requests to a different hostname or port, which restricts its flexibility in multi-environment or distributed system setups.

Solution:
This update introduces the url key as an optional parameter in the call method. When provided, the process constructs the request URL using the specified hostname and port. If the URL key is omitted, the method defaults to the existing base URL.

Usage Example:

call('example.method', {
  url: 'http://localhost:3001'
});

This resolves the request to:

http://localhost:3001/api/method/example.method

@netlify
Copy link

netlify bot commented Dec 13, 2024

Deploy Preview for frappeui ready!

Name Link
🔨 Latest commit 00153c3
🔍 Latest deploy log https://app.netlify.com/sites/frappeui/deploys/675c06b53d3ea00008ac44f1
😎 Deploy Preview https://deploy-preview-239--frappeui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.


// Allow custom path override using the url args
if (args.url) {
path = url + path;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
path = url + path;
path = args.url + path;

?

@surajshetty3416
Copy link
Member

Looks like untested PR

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