mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 04:37:11 +01:00
Updated polling logic.
This commit is contained in:
parent
fdc92d087b
commit
9737127bb1
6 changed files with 33 additions and 19 deletions
|
|
@ -28,3 +28,7 @@ export function getQueryString(params = {}) {
|
|||
|
||||
return '';
|
||||
}
|
||||
|
||||
export function makeUrl(url, params) {
|
||||
return `${url}${getQueryString(params)}`;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue