feat(precedent-library): add district and chair_name to edit form
All checks were successful
Build & Deploy / build-and-deploy (push) Successful in 3m11s
All checks were successful
Build & Deploy / build-and-deploy (push) Successful in 3m11s
Fields existed in DB and Precedent type but were missing from: - PrecedentUpdateRequest (backend model) - update_case_law allowed set (db layer) - PrecedentPatch (frontend type) - precedent-edit-sheet form state, inputs, and patch payload Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -38,6 +38,8 @@ type FormState = {
|
||||
citation: string;
|
||||
case_name: string;
|
||||
court: string;
|
||||
district: string;
|
||||
chair_name: string;
|
||||
decision_date: string;
|
||||
practice_area: PracticeArea;
|
||||
appeal_subtype: string;
|
||||
@@ -51,8 +53,8 @@ type FormState = {
|
||||
};
|
||||
|
||||
const EMPTY: FormState = {
|
||||
citation: "", case_name: "", court: "", decision_date: "",
|
||||
practice_area: "", appeal_subtype: "", source_type: "",
|
||||
citation: "", case_name: "", court: "", district: "", chair_name: "",
|
||||
decision_date: "", practice_area: "", appeal_subtype: "", source_type: "",
|
||||
precedent_level: "", is_binding: true, subject_tags: "",
|
||||
summary: "", headnote: "", key_quote: "",
|
||||
};
|
||||
@@ -75,6 +77,8 @@ export function PrecedentEditSheet({ caseLawId, onOpenChange }: Props) {
|
||||
citation: record.case_number || "",
|
||||
case_name: record.case_name || "",
|
||||
court: record.court || "",
|
||||
district: record.district || "",
|
||||
chair_name: record.chair_name || "",
|
||||
decision_date: record.date ? record.date.slice(0, 10) : "",
|
||||
practice_area: (record.practice_area || "") as PracticeArea,
|
||||
appeal_subtype: appealSubtypeLabel(record.appeal_subtype),
|
||||
@@ -95,6 +99,8 @@ export function PrecedentEditSheet({ caseLawId, onOpenChange }: Props) {
|
||||
const patch: Record<string, unknown> = {
|
||||
case_name: form.case_name.trim(),
|
||||
court: form.court.trim(),
|
||||
district: form.district.trim(),
|
||||
chair_name: form.chair_name.trim(),
|
||||
practice_area: form.practice_area || undefined,
|
||||
appeal_subtype: form.appeal_subtype.trim(),
|
||||
source_type: form.source_type || undefined,
|
||||
@@ -180,6 +186,18 @@ export function PrecedentEditSheet({ caseLawId, onOpenChange }: Props) {
|
||||
<Input id="court" value={form.court}
|
||||
onChange={(e) => setForm({ ...form, court: e.target.value })} />
|
||||
</div>
|
||||
<div className="space-y-1">
|
||||
<Label htmlFor="district">מחוז</Label>
|
||||
<Input id="district" value={form.district}
|
||||
onChange={(e) => setForm({ ...form, district: e.target.value })}
|
||||
placeholder="ירושלים / תל אביב / מרכז" />
|
||||
</div>
|
||||
<div className="space-y-1">
|
||||
<Label htmlFor="chair-name">יו"ר</Label>
|
||||
<Input id="chair-name" value={form.chair_name}
|
||||
onChange={(e) => setForm({ ...form, chair_name: e.target.value })}
|
||||
placeholder="עו״ד דפנה תמיר" />
|
||||
</div>
|
||||
<div className="space-y-1">
|
||||
<Label htmlFor="date">תאריך</Label>
|
||||
<Input id="date" type="date" value={form.decision_date}
|
||||
|
||||
@@ -414,6 +414,8 @@ export type PrecedentPatch = Partial<{
|
||||
source_type: SourceType;
|
||||
precedent_level: string;
|
||||
is_binding: boolean;
|
||||
district: string;
|
||||
chair_name: string;
|
||||
}>;
|
||||
|
||||
export function useUpdatePrecedent() {
|
||||
|
||||
Reference in New Issue
Block a user