fix: change update_memory to correct naming convention

fix: update update_memory to POST
This commit is contained in:
Peter De-Ath 2024-06-14 21:23:34 +01:00
parent 493e3068d8
commit bec00e7e64
3 changed files with 5 additions and 5 deletions

View File

@ -65,7 +65,7 @@ class MemoriesTable:
else:
return None
def update_memory(
def update_memory_by_id(
self,
id: str,
content: str,

View File

@ -64,11 +64,11 @@ async def add_memory(
return memory
@router.patch("/{memory_id}", response_model=Optional[MemoryModel])
async def update_memory(
@router.post("/{memory_id}", response_model=Optional[MemoryModel])
async def update_memory_by_id(
memory_id: str, request: Request, form_data: MemoryUpdateModel, user=Depends(get_verified_user)
):
memory = Memories.update_memory(memory_id, form_data.content)
memory = Memories.update_memory_by_id(memory_id, form_data.content)
if memory is None:
raise HTTPException(status_code=404, detail="Memory not found")

View File

@ -63,7 +63,7 @@ export const updateMemoryById = async (token: string, id: string, content: strin
let error = null;
const res = await fetch(`${WEBUI_API_BASE_URL}/memories/${id}`, {
method: 'PATCH',
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',