This commit is contained in:
yohlo
2025-08-20 22:35:40 -05:00
commit f51c278cd3
169 changed files with 8173 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
import { logger } from "@/lib/logger";
import PocketBase from "pocketbase";
import { transformTeam } from "@/lib/pocketbase/util/transform-types";
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;
}
},
};
}