Skip to content

Commit

Permalink
makin vercel happy 2
Browse files Browse the repository at this point in the history
  • Loading branch information
murtagh27 committed Sep 23, 2024
1 parent 4dd24ea commit b80a876
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions apps/frontend/src/app/events/new/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ export default function NewEventPage() {
<div>
<FormLabel className='block mb-2 font-bold text-lg'>Eddig elfogyasztott italok</FormLabel>
<ul className='mb-4'>
{form.watch('drinkActions').length === 0 ? (
{form.watch('drinkActions')?.length === 0 ? (
<li className='text-gray-500'>Nincs hozzáadott ital</li>
) : (
form.watch('drinkActions')?.map((drink) => (
Expand All @@ -202,9 +202,9 @@ export default function NewEventPage() {
placeholder='egységár'
value={drink.price ?? ''}
onChange={(e) => {
const updatedDrinks = form
.getValues('drinkActions')
.map((d) => (d.id === drink.id ? { ...d, price: Number(e.target.value) } : d));
const updatedDrinks = (form.getValues('drinkActions') ?? []).map((d) =>
d.id === drink.id ? { ...d, price: Number(e.target.value) } : d
);
form.setValue('drinkActions', updatedDrinks);
}}
/>
Expand Down

0 comments on commit b80a876

Please sign in to comment.