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
41import axios from 'axios' ;
2+ import { Method } from 'axios' ;
53import {
64 getMethod ,
75 jsonHeader ,
86 defaultOptions ,
97 getLocationOrigin ,
108} from './fetchTools' ;
11- // #endregion
129
1310export const getSomething = (
1411 endpoint = 'api/getSomethingByDefault' ,
1512) : Promise < any > => {
16- const method = getMethod . method ;
13+ const method = getMethod . method as Method ;
1714 const headers = jsonHeader ;
1815 const url = `${ getLocationOrigin ( ) } /${ endpoint } ` ;
1916 const options = { ...defaultOptions } ;
Original file line number Diff line number Diff line change 1- // @flow
2-
3- // #region imports
41import { Base64 } from 'js-base64' ;
5- // #endregion
62
73// #region window.location.origin polyfill
84export const getLocationOrigin = ( ) : string => {
95 if ( ! window . location . origin ) {
6+ // @ts -ignores
107 window . location . origin = `${ window . location . protocol } //${
118 window . location . hostname
129 } ${ window . location . port ? ':' + window . location . port : '' } `;
Original file line number Diff line number Diff line change 1- // @flow
2-
3- // #region imports
41import auth from '../index' ;
5- // #endregion
2+
63
74describe ( 'auth service' , ( ) => {
85 it ( 'localStorage should exist' , ( ) => {
You can’t perform that action at this time.
0 commit comments