Prepare endpoint

This commit is contained in:
Timothy Armes
2023-09-15 10:43:51 +02:00
parent 2d7e9744e7
commit cf010855b7
6 changed files with 90 additions and 3 deletions
+2
View File
@@ -1,8 +1,10 @@
import { addTournament } from "./procedures/addTournament";
import { fetchTournamentResults } from "./procedures/fetchTournamentResults";
import { router } from "./trpc";
export const appRouter = router({
addTournament,
fetchTournamentResults,
});
export type AppRouter = typeof appRouter;
@@ -0,0 +1,19 @@
import { fetchTournamentResultsSchema } from "@/schemas";
import { errorLog } from "@/utils/logger";
import { publicProcedure } from "../trpc";
export const fetchTournamentResults = publicProcedure
.input(fetchTournamentResultsSchema)
.mutation(async ({ input }) => {
try {
console.log(input.url);
// Fetch the tournament results using Python
return true;
} catch (error) {
errorLog(error);
throw error;
}
});