File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
firestore-shorten-urls-bitly/functions Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ class FirestoreBitlyUrlShortener extends abstract_shortener_1.FirestoreUrlShorte
34
34
this . instance = axios_1 . default . create ( {
35
35
headers : {
36
36
Authorization : `Bearer ${ bitlyAccessToken } ` ,
37
+ "Content-Type" : "application/json" ,
37
38
} ,
38
39
baseURL : "https://api-ssl.bitly.com/v4/" ,
39
40
} ) ;
@@ -47,7 +48,7 @@ class FirestoreBitlyUrlShortener extends abstract_shortener_1.FirestoreUrlShorte
47
48
const response = yield this . instance . post ( "bitlinks" , {
48
49
long_url : url ,
49
50
} ) ;
50
- const { link } = response ;
51
+ const { link } = response . data ;
51
52
logs . shortenUrlComplete ( link ) ;
52
53
yield this . updateShortUrl ( snapshot , link ) ;
53
54
}
Original file line number Diff line number Diff line change @@ -34,9 +34,11 @@ class FirestoreBitlyUrlShortener extends FirestoreUrlShortener {
34
34
this . instance = axios . create ( {
35
35
headers : {
36
36
Authorization : `Bearer ${ bitlyAccessToken } ` ,
37
+ "Content-Type" : "application/json" ,
37
38
} ,
38
39
baseURL : "https://api-ssl.bitly.com/v4/" ,
39
40
} ) ;
41
+
40
42
logs . init ( ) ;
41
43
}
42
44
@@ -51,7 +53,7 @@ class FirestoreBitlyUrlShortener extends FirestoreUrlShortener {
51
53
long_url : url ,
52
54
} ) ;
53
55
54
- const { link } = response ;
56
+ const { link } = response . data ;
55
57
56
58
logs . shortenUrlComplete ( link ) ;
57
59
You can’t perform that action at this time.
0 commit comments