mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-10 07:05:35 +00:00
fix url shortener
This commit is contained in:
@@ -8,7 +8,7 @@ import request from 'superagent';
|
|||||||
* @param {function} error Failure/Error callback
|
* @param {function} error Failure/Error callback
|
||||||
*/
|
*/
|
||||||
export default function shorternUrl(url, success, error) {
|
export default function shorternUrl(url, success, error) {
|
||||||
orbisUpload(url, success, error);
|
orbisShorten(url, success, error);
|
||||||
}
|
}
|
||||||
|
|
||||||
const SHORTEN_API_GOOGLE = 'https://www.googleapis.com/urlshortener/v1/url?key=';
|
const SHORTEN_API_GOOGLE = 'https://www.googleapis.com/urlshortener/v1/url?key=';
|
||||||
@@ -72,7 +72,7 @@ const SHORTEN_API_ORBIS = 'https://s.orbis.zone/a';
|
|||||||
* @param {function} success Success callback
|
* @param {function} success Success callback
|
||||||
* @param {function} error Failure/Error callback
|
* @param {function} error Failure/Error callback
|
||||||
*/
|
*/
|
||||||
function orbisUpload(url, success, error) {
|
function orbisShorten(url, success, error) {
|
||||||
if (window.navigator.onLine) {
|
if (window.navigator.onLine) {
|
||||||
try {
|
try {
|
||||||
request.post(SHORTEN_API_ORBIS)
|
request.post(SHORTEN_API_ORBIS)
|
||||||
|
|||||||
Reference in New Issue
Block a user