Skip to content

Commit c2fa8e3

Browse files
committed
migration
1 parent a901456 commit c2fa8e3

File tree

3 files changed

+4
-13
lines changed

3 files changed

+4
-13
lines changed

front/src/services/API/example.js renamed to front/src/services/API/example.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
1-
// @flow
2-
3-
// #region imports
41
import axios from 'axios';
2+
import { Method } from 'axios';
53
import {
64
getMethod,
75
jsonHeader,
86
defaultOptions,
97
getLocationOrigin,
108
} from './fetchTools';
11-
// #endregion
129

1310
export 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 };

front/src/services/API/fetchTools.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
1-
// @flow
2-
3-
// #region imports
41
import { Base64 } from 'js-base64';
5-
// #endregion
62

73
// #region window.location.origin polyfill
84
export 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 : ''}`;

front/src/services/auth/__tests__/auth.test.js renamed to front/src/services/auth/__tests__/auth.test.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
// @flow
2-
3-
// #region imports
41
import auth from '../index';
5-
// #endregion
2+
63

74
describe('auth service', () => {
85
it('localStorage should exist', () => {

0 commit comments

Comments
 (0)