Skip to content

Commit e7e065b

Browse files
author
Hugo Marcellin
committed
PR remarks
1 parent 030d379 commit e7e065b

File tree

2 files changed

+6
-18
lines changed

2 files changed

+6
-18
lines changed

src/utils/custom-hooks.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,7 @@
66
*/
77

88
import { useEffect, useCallback, useReducer, useState } from 'react';
9-
10-
export const FetchStatus = {
11-
IDLE: 'IDLE',
12-
FETCHING: 'FETCHING',
13-
FETCH_SUCCESS: 'FETCH_SUCCESS',
14-
FETCH_ERROR: 'FETCH_ERROR',
15-
};
9+
import { FetchStatus } from '@gridsuite/commons-ui';
1610

1711
export const ActionType = {
1812
START: 'START',

src/utils/rest-api.js

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ import ReconnectingWebSocket from 'reconnecting-websocket';
1111
import { ContingencyListType } from './elementType';
1212
import { CONTINGENCY_ENDPOINTS } from './constants-endpoints';
1313
import {
14-
ElementType,
15-
fetchEnv,
16-
backendFetch,
17-
backendFetchJson,
18-
backendFetchText,
14+
ElementType,
15+
fetchEnv,
16+
backendFetch,
17+
backendFetchJson,
18+
backendFetchText, getRequestParamFromList
1919
} from '@gridsuite/commons-ui';
2020

2121
const PREFIX_USER_ADMIN_SERVER_QUERIES =
@@ -42,12 +42,6 @@ function getToken() {
4242
return state.user.id_token;
4343
}
4444

45-
export const getRequestParamFromList = (params, paramName) => {
46-
return new URLSearchParams(
47-
params?.length ? params.map((param) => [paramName, param]) : []
48-
);
49-
};
50-
5145
export function connectNotificationsWsUpdateConfig() {
5246
const webSocketBaseUrl = document.baseURI
5347
.replace(/^http:\/\//, 'ws://')

0 commit comments

Comments
 (0)