Skip to content

Commit

Permalink
Implement react side of player page export
Browse files Browse the repository at this point in the history
  • Loading branch information
AuroraLS3 committed Dec 2, 2022
1 parent 801f51d commit 5524a64
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Plan/react/dashboard/src/service/playerService.js
Original file line number Diff line number Diff line change
@@ -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}&timestamp=${timestamp}`;
let url = `/v1/player?player=${uuid}&timestamp=${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
})
Expand Down

0 comments on commit 5524a64

Please sign in to comment.