Closed dej611 closed 1 year ago
Pinging @elastic/appex-sharedux (Team:SharedUX)
Adding my +1 to this, we have a need in Discover as well.
It is possible using the .crateWithLocator
method. Like this:
const shortUrl = await shortUrls.createWithLocator({ locator, params });
const absoluteShortUrl = shortUrl.locator.getUrl(shortUrl.params, { absolute: true });
I still don't think this covers my use case: I'd like to generate a URL with getRedirectUrl
that is absolute. Right now I think I have to manually convert to the absolute URL myself using relativeToAbsolute
. Am I missing something?
Describe the feature:
At the moment it is not trivial to rebuild an absolute URL with the ShortURL service.
In Lens we've combined the
ShortURL.create
method with theapplication.getUrlForApp
one:In the
Share
service a legacy service is used, which I think should be replaced:In the first case that is not too bad, but I was think to propose a convenience
absolute
param for theShortURL.create
to make it one-liner: