mirror of
https://github.com/open-webui/open-webui
synced 2024-11-17 14:02:51 +00:00
fix: change update_memory to correct naming convention
fix: update update_memory to POST
This commit is contained in:
parent
493e3068d8
commit
bec00e7e64
@ -65,7 +65,7 @@ class MemoriesTable:
|
||||
else:
|
||||
return None
|
||||
|
||||
def update_memory(
|
||||
def update_memory_by_id(
|
||||
self,
|
||||
id: str,
|
||||
content: str,
|
||||
|
@ -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")
|
||||
|
||||
|
@ -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',
|
||||
|
Loading…
Reference in New Issue
Block a user