Skip to content

Commit

Permalink
fix: casters are now fully working
Browse files Browse the repository at this point in the history
  • Loading branch information
DevNono committed Aug 21, 2023
1 parent 4070ebc commit 28aac23
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions src/operations/caster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@ import { nanoid } from 'nanoid';
import { Caster, PrismaPromise, TournamentId } from '@prisma/client';
import database from '../services/database';

export const removeAllCastersFromTournament = (tournamentId: TournamentId): boolean => {
export const removeAllCastersFromTournament = (tournamentId: TournamentId) =>
database.caster.deleteMany({
where: {
tournamentId,
},
});

return true;
};

export const addCasterToTournament = (tournamentId: TournamentId, name: string): PrismaPromise<Caster> =>
database.caster.create({
data: {
Expand Down
2 changes: 1 addition & 1 deletion src/operations/tournament.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,5 @@ export const updateTournament = (
): PrismaPromise<PrimitiveTournament> =>
database.tournament.update({
where: { id },
data,
data: { ...data, casters: undefined },
});

0 comments on commit 28aac23

Please sign in to comment.