aboutsummaryrefslogtreecommitdiff
path: root/api
diff options
context:
space:
mode:
authorlonkaars <l.leblansch@gmail.com>2021-03-10 16:06:42 +0100
committerlonkaars <l.leblansch@gmail.com>2021-03-10 16:06:42 +0100
commit6fbf48dcd658db76d6ccd375ac9e8b0f5123df18 (patch)
treeb1ab5050adbfb73c06af51cc884a2703747a5951 /api
parent91e284d685dab7525c9526be1cb264a7a9c65c5c (diff)
/user/games opponent user_format + oppponent fix
Diffstat (limited to 'api')
-rw-r--r--api/api.ts2
-rw-r--r--api/user/games.py3
2 files changed, 3 insertions, 2 deletions
diff --git a/api/api.ts b/api/api.ts
index 0b37441..1db6e0e 100644
--- a/api/api.ts
+++ b/api/api.ts
@@ -50,7 +50,7 @@ export interface gameInfo {
duration: number;
id: string;
moves: Array<number>;
- opponent: string;
+ opponent: userInfo;
outcome: outcome;
parent?: string;
private: boolean;
diff --git a/api/user/games.py b/api/user/games.py
index 95bd38a..c61151a 100644
--- a/api/user/games.py
+++ b/api/user/games.py
@@ -3,6 +3,7 @@ from functools import reduce
from mergedeep import merge
from db import cursor
from auth.login_token import token_login
+from user.info import format_user
from ruleset import resolve_ruleset
import json
@@ -30,7 +31,7 @@ def game_info(game_id, user_id = None):
"id": game[0],
"parent": game[1],
"moves": [int(move) for move in str(game[2]).split(",")],
- "opponent": game[3] if is_player_1 else game[4],
+ "opponent": format_user(game[4] if is_player_1 else game[3]),
"outcome": outcome,
"created": game[6],
"started": game[7],