Skip to content

Commit

Permalink
fix(import): 504 error
Browse files Browse the repository at this point in the history
  • Loading branch information
jonassimoen committed Oct 31, 2023
1 parent 2ee3f95 commit 0e74542
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/controllers/Player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export const DeletePlayerHandler = async (req: any, rep: any) => {

export const ImportPlayersHandler = async (req: any, rep: any) => {
console.log("importing players");
rep.send({msg: "Importing players has started"});
// should import images too: https://media.api-sports.io/football/teams/{team_id}.png

// const data = JSON.parse(fs.readFileSync(path.join(__dirname, '../assets/players.json'), 'utf-8')); # dev purposes only
Expand Down Expand Up @@ -74,7 +75,7 @@ export const ImportPlayersHandler = async (req: any, rep: any) => {
const createdPlayers = await prisma.player.createMany({
data: respToData,
})
rep.send(createdPlayers)
// rep.send(createdPlayers)
} catch (err: any) {
throw new Error("Prisma error "+ err);
}
Expand Down

0 comments on commit 0e74542

Please sign in to comment.