forked from CSGOWTF/csgowtf
added load-more button to player match-list
This commit is contained in:
@@ -66,3 +66,16 @@ export const getPlayerValue = async (match_id) => {
|
||||
console.log(err.response.status, err.response.statusText)
|
||||
}
|
||||
}
|
||||
|
||||
export const loadMoreMatches = async (player_id, date) => {
|
||||
try {
|
||||
const res = await axios.get(`${API_URL}/player/${player_id}/after/${date}`)
|
||||
|
||||
if (res.status === 200) {
|
||||
return res.data
|
||||
}
|
||||
} catch (err) {
|
||||
// TODO: 400, 404
|
||||
console.log(err.response.status, err.response.statusText)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ import {GoToLink, GoToMatch, GoToPlayer} from "./GoTo";
|
||||
import {SaveLastVisitedToLocalStorage} from "./LocalStorage";
|
||||
import {GetHLTV_1} from "./HLTV";
|
||||
import {DisplayRank, LoadImage} from "./Display";
|
||||
import {GetUser, TrackMe, getPlayerValue} from "./ApiRequests";
|
||||
import {GetUser, TrackMe, getPlayerValue, loadMoreMatches} from "./ApiRequests";
|
||||
import {setTitle, GetWinLoss, truncate, checkStatEmpty, getPlayerArr, constructAvatarUrl, GetAvgRank, FixMapName, closeNav} from "./Utils";
|
||||
|
||||
export {
|
||||
@@ -12,6 +12,6 @@ export {
|
||||
SaveLastVisitedToLocalStorage,
|
||||
GetHLTV_1,
|
||||
DisplayRank, LoadImage,
|
||||
GetUser, TrackMe, getPlayerValue,
|
||||
GetUser, TrackMe, getPlayerValue, loadMoreMatches,
|
||||
setTitle, GetWinLoss, truncate, checkStatEmpty, getPlayerArr, constructAvatarUrl, GetAvgRank, FixMapName, closeNav
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user