Updated short URL visits loading so that it loads visits in several requests

This commit is contained in:
Alejandro Celaya
2019-01-10 19:50:25 +01:00
parent 58d3a59e58
commit 0c1f533747
2 changed files with 18 additions and 5 deletions

View File

@@ -22,9 +22,9 @@ export default class ShlinkApiClient {
.then((resp) => resp.data);
};
getShortUrlVisits = (shortCode, dates) =>
this._performRequest(`/short-urls/${shortCode}/visits`, 'GET', dates)
.then((resp) => resp.data.visits.data);
getShortUrlVisits = (shortCode, query) =>
this._performRequest(`/short-urls/${shortCode}/visits`, 'GET', query)
.then((resp) => resp.data.visits);
getShortUrl = (shortCode) =>
this._performRequest(`/short-urls/${shortCode}`, 'GET')