player stats in profile
This commit is contained in:
@@ -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;
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user