File tree Expand file tree Collapse file tree 3 files changed +4
-13
lines changed Expand file tree Collapse file tree 3 files changed +4
-13
lines changed Original file line number Diff line number Diff line change 1
- // @flow
2
-
3
- // #region imports
4
1
import axios from 'axios' ;
2
+ import { Method } from 'axios' ;
5
3
import {
6
4
getMethod ,
7
5
jsonHeader ,
8
6
defaultOptions ,
9
7
getLocationOrigin ,
10
8
} from './fetchTools' ;
11
- // #endregion
12
9
13
10
export const getSomething = (
14
11
endpoint = 'api/getSomethingByDefault' ,
15
12
) : Promise < any > => {
16
- const method = getMethod . method ;
13
+ const method = getMethod . method as Method ;
17
14
const headers = jsonHeader ;
18
15
const url = `${ getLocationOrigin ( ) } /${ endpoint } ` ;
19
16
const options = { ...defaultOptions } ;
Original file line number Diff line number Diff line change 1
- // @flow
2
-
3
- // #region imports
4
1
import { Base64 } from 'js-base64' ;
5
- // #endregion
6
2
7
3
// #region window.location.origin polyfill
8
4
export const getLocationOrigin = ( ) : string => {
9
5
if ( ! window . location . origin ) {
6
+ // @ts -ignores
10
7
window . location . origin = `${ window . location . protocol } //${
11
8
window . location . hostname
12
9
} ${ window . location . port ? ':' + window . location . port : '' } `;
Original file line number Diff line number Diff line change 1
- // @flow
2
-
3
- // #region imports
4
1
import auth from '../index' ;
5
- // #endregion
2
+
6
3
7
4
describe ( 'auth service' , ( ) => {
8
5
it ( 'localStorage should exist' , ( ) => {
You can’t perform that action at this time.
0 commit comments