Updated polling logic.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { getQueryString } from './url';
|
||||
import { makeUrl } from './url';
|
||||
|
||||
export const apiRequest = (method, url, body, headers) =>
|
||||
fetch(url, {
|
||||
@@ -20,10 +20,10 @@ export const apiRequest = (method, url, body, headers) =>
|
||||
});
|
||||
|
||||
export const get = (url, params, headers) =>
|
||||
apiRequest('get', `${url}${getQueryString(params)}`, undefined, headers);
|
||||
apiRequest('get', makeUrl(url, params), undefined, headers);
|
||||
|
||||
export const del = (url, params, headers) =>
|
||||
apiRequest('delete', `${url}${getQueryString(params)}`, undefined, headers);
|
||||
apiRequest('delete', makeUrl(url, params), undefined, headers);
|
||||
|
||||
export const post = (url, params, headers) =>
|
||||
apiRequest('post', url, JSON.stringify(params), headers);
|
||||
|
||||
Reference in New Issue
Block a user