significant refactor
This commit is contained in:
@@ -6,15 +6,11 @@ import { Team } from "@/features/teams/types";
|
||||
export function createTeamsService(pb: PocketBase) {
|
||||
return {
|
||||
async getTeam(id: string): Promise<Team | null> {
|
||||
try {
|
||||
logger.info('PocketBase | Getting team', id);
|
||||
const result = await pb.collection('teams').getOne(id, {
|
||||
expand: 'players, tournaments'
|
||||
});
|
||||
return transformTeam(result);
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
logger.info("PocketBase | Getting team", id);
|
||||
const result = await pb.collection("teams").getOne(id, {
|
||||
expand: "players, tournaments",
|
||||
});
|
||||
return transformTeam(result);
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user