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, - }); - }} - > +