File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import EndpointPath from '~/enums/endpointPath';
55import FetchStatusCode from '~/enums/fetchStatusCode' ;
66import ApolloClient from '~/helpers/ApolloClient' ;
77import IError from '~/models/IError' ;
8+ import { trimObjectWhiteSpaces } from '~/utils/trimWhiteSpaces' ;
89import AlertStore from '~/stores/alertStore' ;
910import LoginStore from '~/stores/loginStore' ;
1011
@@ -83,7 +84,7 @@ class HttpUtils {
8384 object : any ,
8485 credentials ?: credentials
8586 ) => {
86- const formattedObject = _format ( object ) ;
87+ const formattedObject = _format ( trimObjectWhiteSpaces ( object ) ) ;
8788 let error : IError | null = null ;
8889
8990 try {
Original file line number Diff line number Diff line change 1+ const trimStrings = ( key : unknown , value : unknown ) => {
2+ if ( typeof value === 'string' ) {
3+ return value . trim ( ) ;
4+ }
5+
6+ return value ;
7+ } ;
8+
9+ // Taken from here: https://codepen.io/ajmueller/pen/NyXNME
10+ export const trimObjectWhiteSpaces = ( object : Object ) => {
11+ return JSON . parse ( JSON . stringify ( object , trimStrings , 4 ) ) ;
12+ } ;
You can’t perform that action at this time.
0 commit comments