diff --git a/src/components/FieldSetWithStatus.tsx b/src/components/FieldSetWithStatus.tsx index 844d3ae3..dcac825c 100644 --- a/src/components/FieldSetWithStatus.tsx +++ b/src/components/FieldSetWithStatus.tsx @@ -57,9 +57,10 @@ export default function FieldSetWithStatus({ id={id} name={id} value={value} + checked={type === 'checkbox' ? value === 'true' : undefined} placeholder={placeholder} onChange={e => onChange?.(type === 'checkbox' - ? e.target.value ? 'true' : 'false' + ? e.target.value === 'true' ? 'false' : 'true' : e.target.value)} type={type} autoComplete="off" diff --git a/src/photo/form.ts b/src/photo/form.ts index b4ea8580..e9b0f5a4 100644 --- a/src/photo/form.ts +++ b/src/photo/form.ts @@ -62,6 +62,8 @@ export const convertPhotoToFormData = ( return value?.join ? value.join(', ') : value; case 'takenAt': return value?.toISOString ? value.toISOString() : value; + case 'hidden': + return value ? 'true' : 'false'; default: return value !== undefined && value !== null ? value.toString()