[short url] use url.format when creating /goto link
This commit is contained in:
parent
a8c1305a9b
commit
2a716734d0
|
@ -16,7 +16,11 @@ export default function createUrlShortener(Notifier, $http, $location) {
|
|||
const formData = { url: relativeUrl };
|
||||
|
||||
return $http.post(`${basePath}/shorten`, formData).then((result) => {
|
||||
return `${parsedUrl.protocol}//${parsedUrl.host}${basePath}/goto/${result.data}`;
|
||||
return url.format({
|
||||
protocol: parsedUrl.protocol,
|
||||
host: parsedUrl.host,
|
||||
pathname: `${basePath}/goto/${result.data}`
|
||||
});
|
||||
}).catch((response) => {
|
||||
notify.error(response);
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue