mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-01-12 03:13:46 +01:00
Implement react side of player page export
This commit is contained in:
parent
801f51d823
commit
5524a64747
@ -1,14 +1,15 @@
|
||||
import {faMapSigns} from "@fortawesome/free-solid-svg-icons";
|
||||
import {doSomeGetRequest, standard200option} from "./backendConfiguration";
|
||||
import {doSomeGetRequest, standard200option, staticSite} from "./backendConfiguration";
|
||||
|
||||
export const fetchPlayer = async (timestamp, uuid) => {
|
||||
const url = `/v1/player?player=${uuid}×tamp=${timestamp}`;
|
||||
let url = `/v1/player?player=${uuid}×tamp=${timestamp}`;
|
||||
if (staticSite) url = `/player/${uuid}/player-${uuid}.json`
|
||||
return doSomeGetRequest(url, [
|
||||
standard200option,
|
||||
{
|
||||
status: 400,
|
||||
status: staticSite ? 404 : 400,
|
||||
get: () => ({
|
||||
message: 'Player not found: ' + uuid + ', try another player',
|
||||
message: 'Player not found: ' + uuid + ', try another player.' + (staticSite ? ' You can try the export players command.' : ''),
|
||||
title: '404 Player not found',
|
||||
icon: faMapSigns
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user