forked from CSGOWTF/csgowtf
#5 added Hitgroup-Puppet to DamageSite
This commit is contained in:
@@ -55,7 +55,7 @@ export const TrackMe = async (id64, authcode, sharecode = '') => {
|
||||
return [status, statusError]
|
||||
}
|
||||
|
||||
export const getPlayerValue = async (match_id) => {
|
||||
export const GetPlayerValue = async (match_id) => {
|
||||
try {
|
||||
const res = await axios.get(`${API_URL}/match/${match_id}/rounds`)
|
||||
|
||||
@@ -67,7 +67,7 @@ export const getPlayerValue = async (match_id) => {
|
||||
}
|
||||
}
|
||||
|
||||
export const getMatchDetails = async (match_id) => {
|
||||
export const GetMatchDetails = async (match_id) => {
|
||||
try {
|
||||
const res = await axios.get(`${API_URL}/match/${match_id}`)
|
||||
|
||||
@@ -80,7 +80,7 @@ export const getMatchDetails = async (match_id) => {
|
||||
}
|
||||
}
|
||||
|
||||
export const loadMoreMatches = async (player_id, date) => {
|
||||
export const LoadMoreMatches = async (player_id, date) => {
|
||||
try {
|
||||
const res = await axios.get(`${API_URL}/player/${player_id}/next/${date}`)
|
||||
|
||||
@@ -93,7 +93,7 @@ export const loadMoreMatches = async (player_id, date) => {
|
||||
}
|
||||
}
|
||||
|
||||
export const getPlayerMeta = async (player_id, limit = 4) => {
|
||||
export const GetPlayerMeta = async (player_id, limit = 4) => {
|
||||
try {
|
||||
const res = await axios.get(`${API_URL}/player/${player_id}/meta/${limit}`)
|
||||
|
||||
@@ -105,3 +105,16 @@ export const getPlayerMeta = async (player_id, limit = 4) => {
|
||||
console.log(err.response.status, err.response.statusText)
|
||||
}
|
||||
}
|
||||
|
||||
export const GetWeaponDmg = async (match_id) => {
|
||||
try {
|
||||
const res = await axios.get(`${API_URL}/match/${match_id}/weapons`)
|
||||
|
||||
if (res.status === 200) {
|
||||
return res.data
|
||||
}
|
||||
} catch (e) {
|
||||
// TODO: 400, 404
|
||||
console.log(e)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,3 +99,11 @@ export const sortObjectValue = (obj, direction = 'asc') => {
|
||||
|
||||
return sortable
|
||||
}
|
||||
|
||||
export const CreatePlayersArray = (stats) => {
|
||||
let arr = []
|
||||
for (let i in stats) {
|
||||
arr.push({team_id: stats[i].team_id, player: stats[i].player})
|
||||
}
|
||||
return arr
|
||||
}
|
||||
|
||||
@@ -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 {getMatchDetails, getPlayerMeta, getPlayerValue, GetUser, loadMoreMatches, TrackMe} from "./ApiRequests";
|
||||
import {GetMatchDetails, GetPlayerMeta, GetPlayerValue, GetUser, LoadMoreMatches, TrackMe, GetWeaponDmg} from "./ApiRequests";
|
||||
import {
|
||||
checkStatEmpty,
|
||||
closeNav,
|
||||
@@ -14,7 +14,8 @@ import {
|
||||
GetWinLoss,
|
||||
setTitle,
|
||||
truncate,
|
||||
sortObjectValue
|
||||
sortObjectValue,
|
||||
CreatePlayersArray
|
||||
} from "./Utils";
|
||||
|
||||
export {
|
||||
@@ -32,10 +33,10 @@ export {
|
||||
LoadImage,
|
||||
GetUser,
|
||||
TrackMe,
|
||||
getPlayerValue,
|
||||
loadMoreMatches,
|
||||
getPlayerMeta,
|
||||
getMatchDetails,
|
||||
GetPlayerValue,
|
||||
LoadMoreMatches,
|
||||
GetPlayerMeta,
|
||||
GetMatchDetails,
|
||||
setTitle,
|
||||
GetWinLoss,
|
||||
truncate,
|
||||
@@ -45,5 +46,7 @@ export {
|
||||
GetAvgRank,
|
||||
FixMapName,
|
||||
closeNav,
|
||||
sortObjectValue
|
||||
sortObjectValue,
|
||||
GetWeaponDmg,
|
||||
CreatePlayersArray
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user