Skip to content

Commit

Permalink
fix: add initial varieties to coffee form
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelblijleven committed Oct 3, 2023
1 parent 14c9242 commit 9057cd6
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/app/coffee/components/coffee-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,17 @@ type VarietyFieldsetProps<TFieldValues extends FieldValues = FieldValues> = {
remove: UseFieldArrayRemove,
}

const defaultVarietyValues = {
name: "",
processing: "",
country: "",
region: "",
farm: "",
farmer: "",
elevation: "",
beanId: null,
}

const defaultValues = {
name: "",
roastDate: undefined,
Expand All @@ -52,18 +63,7 @@ const defaultValues = {
roasterId: 0,
isPublic: false,
isArchived: false,
varieties: [],
}

const defaultVarietyValues = {
name: "",
processing: "",
country: "",
region: "",
farm: "",
farmer: "",
elevation: "",
beanId: null,
varieties: [{...defaultVarietyValues}],
}

function VarietyFieldset<TFieldValues extends FieldValues = FieldValues>({
Expand Down

0 comments on commit 9057cd6

Please sign in to comment.