File tree 2 files changed +12
-9
lines changed
2 files changed +12
-9
lines changed Original file line number Diff line number Diff line change 1
- import { AxiosPromise } from 'axios' ;
1
+ import axios , { AxiosInstance , AxiosPromise } from 'axios' ;
2
2
3
3
import { IStatus } from '..' ;
4
4
5
- import { PubgAPIEndpoint } from './base' ;
5
+ export class StatusPubgAPI {
6
+ private _axios : AxiosInstance ;
6
7
8
+ constructor ( ) {
9
+ this . _axios = axios . create ( {
10
+ baseURL : `https://api.playbattlegrounds.com/` ,
11
+ } ) ;
12
+ }
7
13
8
- export class StatusPubgAPI extends PubgAPIEndpoint {
9
-
10
- get ( ) : AxiosPromise < IStatus > {
11
- return this . api . axios . get ( `/status` ) ;
12
- }
13
-
14
+ get ( ) : AxiosPromise < IStatus > {
15
+ return this . _axios . get ( `/status` ) ;
16
+ }
14
17
}
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ export class Status {
16
16
}
17
17
18
18
static async get ( api : PubgAPI ) : Promise < Status > {
19
- const statusAPI : StatusPubgAPI = new StatusPubgAPI ( api ) ;
19
+ const statusAPI : StatusPubgAPI = new StatusPubgAPI ( ) ;
20
20
const startDate : Date = new Date ( ) ;
21
21
22
22
const statusData = await statusAPI . get ( ) ;
You can’t perform that action at this time.
0 commit comments