From 3c9b53b53f8efb810ed2e2efd964a5019f98b480 Mon Sep 17 00:00:00 2001 From: moe-berri Date: Sat, 12 Sep 2026 13:39:21 -0700 Subject: [PATCH] refactor(memory): name the dashboard correction handler --- .../_components/AutomaticMemoryEntries.tsx | 42 +++++++++---------- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/ui/litellm-dashboard/src/app/(dashboard)/memory/_components/AutomaticMemoryEntries.tsx b/ui/litellm-dashboard/src/app/(dashboard)/memory/_components/AutomaticMemoryEntries.tsx index 90b578b09f0..3a1b671eb30 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/memory/_components/AutomaticMemoryEntries.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/memory/_components/AutomaticMemoryEntries.tsx @@ -1,7 +1,7 @@ "use client"; import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; -import { useState } from "react"; +import { type FormEvent, useState } from "react"; import DeleteResourceModal from "@/components/common_components/DeleteResourceModal"; import { Button } from "@/components/ui/button"; @@ -68,6 +68,23 @@ export function AutomaticMemoryEntries({ userId, readOnly }: Readonly<{ userId: setEditing(null); setDeleting(null); }; + const saveCorrection = (event: FormEvent) => { + event.preventDefault(); + if (!editing) return; + const body: Capture = { + key: editing.key, + title: editing.title, + content: editing.content, + evidence: editing.evidence, + when_to_use: editing.when_to_use, + scope: editing.scope, + kind: editing.kind, + certainty: editing.certainty, + source: editing.source, + expected_revision: editing.updated_at, + }; + save.mutate({ key: keyId, body }); + }; return (

@@ -121,28 +138,7 @@ export function AutomaticMemoryEntries({ userId, readOnly }: Readonly<{ userId: ))} {editing && ( -
{ - event.preventDefault(); - const body: Capture = { - key: editing.key, - title: editing.title, - content: editing.content, - evidence: editing.evidence, - when_to_use: editing.when_to_use, - scope: editing.scope, - kind: editing.kind, - certainty: editing.certainty, - source: editing.source, - expected_revision: editing.updated_at, - }; - save.mutate({ - key: keyId, - body, - }); - }} - > +