refactor(web): drop redundant fields/visibility casts now the client is typed (#24 #29)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-04 20:20:13 +02:00
parent 5a72f85989
commit 0ee3b970cb
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -52,7 +52,7 @@ export function ObjectDetail() {
return byLang ?? byEnglish ?? key; return byLang ?? byEnglish ?? key;
}; };
const flexible = Object.entries(object.fields as Record<string, unknown>); const flexible = Object.entries(object.fields);
return ( return (
<div className="overflow-auto p-4"> <div className="overflow-auto p-4">
+1 -1
View File
@@ -34,7 +34,7 @@ export function ObjectEditForm() {
recording_date: object.recording_date ?? null, recording_date: object.recording_date ?? null,
}; };
const defaults = { core, fields: object.fields as Record<string, unknown> }; const defaults = { core, fields: object.fields };
const onSubmit = async (values: ObjectFormValues) => { const onSubmit = async (values: ObjectFormValues) => {
setError(null); setError(null);
+1 -1
View File
@@ -23,7 +23,7 @@ const STEPS: Visibility[] = ["draft", "internal", "public"];
export function PublishControl({ object }: { object: AdminObjectView }) { export function PublishControl({ object }: { object: AdminObjectView }) {
const { t } = useTranslation(); const { t } = useTranslation();
const current = object.visibility as Visibility; const current = object.visibility;
const { forward, back } = adjacentTransitions(current); const { forward, back } = adjacentTransitions(current);
const setVisibility = useSetVisibility(); const setVisibility = useSetVisibility();
const [confirmOpen, setConfirmOpen] = useState(false); const [confirmOpen, setConfirmOpen] = useState(false);