mirror of
https://github.com/imputnet/cobalt.git
synced 2025-01-15 03:15:14 +00:00
Remove resolveShortLink function
apply suggestions
This commit is contained in:
parent
41296b7413
commit
e775d4c5e7
|
@ -48,15 +48,12 @@ async function getAccessToken() {
|
|||
return access_token;
|
||||
}
|
||||
|
||||
async function resolveShortLink(url) {
|
||||
return await getRedirectingURL(url);
|
||||
}
|
||||
|
||||
export default async function(obj) {
|
||||
let url;
|
||||
|
||||
if (obj.shortLink) {
|
||||
const resolvedUrl = await resolveShortLink(obj.shortLink);
|
||||
const resolvedUrl = await getRedirectingURL(obj.shortLink);
|
||||
if (!resolvedUrl) return { error: "fetch.short_link" };
|
||||
url = new URL(resolvedUrl);
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue