player stats in profile

This commit is contained in:
yohlo
2025-09-13 11:21:05 -05:00
parent 7d3c0a3fa4
commit 3fe92be980
7 changed files with 243 additions and 17 deletions

View File

@@ -3,6 +3,7 @@ import type {
PlayerInfo,
PlayerInput,
PlayerUpdateInput,
PlayerStats,
} from "@/features/players/types";
import { transformPlayer, transformPlayerInfo } from "@/lib/pocketbase/util/transform-types";
import PocketBase from "pocketbase";
@@ -62,5 +63,12 @@ export function createPlayersService(pb: PocketBase) {
});
return result.map(transformPlayer);
},
async getPlayerStats(playerId: string): Promise<PlayerStats[]> {
const result = await pb.collection("player_stats").getFullList<PlayerStats>({
filter: `player_id = "${playerId}"`,
});
return result;
},
};
}