diff --git a/app/(main)/league/[leagueId]/entry/[entryId]/week/Week.interface.ts b/app/(main)/league/[leagueId]/entry/[entryId]/week/Week.interface.ts index e2dddd54..a5ce7f9c 100644 --- a/app/(main)/league/[leagueId]/entry/[entryId]/week/Week.interface.ts +++ b/app/(main)/league/[leagueId]/entry/[entryId]/week/Week.interface.ts @@ -9,7 +9,7 @@ import { IUser, } from '@/api/apiFunctions.interface'; -export interface IData { +export interface IWeekData { target: { value: string; }; @@ -24,7 +24,7 @@ export interface IWeekParams { } export interface IWeeklyPickChange { - data: IData; + data: IWeekData; entry: string; league: string; NFLTeams: INFLTeam[]; diff --git a/app/(main)/league/[leagueId]/entry/[entryId]/week/Week.tsx b/app/(main)/league/[leagueId]/entry/[entryId]/week/Week.tsx index a7fda224..9b9b3f30 100644 --- a/app/(main)/league/[leagueId]/entry/[entryId]/week/Week.tsx +++ b/app/(main)/league/[leagueId]/entry/[entryId]/week/Week.tsx @@ -101,7 +101,11 @@ const Week = ({ entry, league, NFLTeams, week }: IWeekProps): JSX.Element => { weeklyPicks, week, }; - await onWeeklyPickChange(params); + try { + await onWeeklyPickChange(params); + } catch (error) { + console.error('Error while changing pick:', error); + } }; useEffect(() => { diff --git a/app/(main)/league/[leagueId]/entry/[entryId]/week/WeekHelper.tsx b/app/(main)/league/[leagueId]/entry/[entryId]/week/WeekHelper.tsx index 3d5827bd..ac4dba09 100644 --- a/app/(main)/league/[leagueId]/entry/[entryId]/week/WeekHelper.tsx +++ b/app/(main)/league/[leagueId]/entry/[entryId]/week/WeekHelper.tsx @@ -80,12 +80,12 @@ export const onWeeklyPickChange = async ({ />, ); } catch (error) { - console.error('Submission error:', error); toast.custom( , ); + throw new Error(`Error running onWeeklyPickChange: ${error}`); } };