fix: add preview to delete response for MCP server compatibility

This commit is contained in:
Viktor Barzin 2026-03-14 11:14:05 +00:00
parent 3207ecf3e9
commit 58ea218044
No known key found for this signature in database
GPG key ID: 0EB088298288D958
2 changed files with 6 additions and 4 deletions

View file

@ -200,7 +200,7 @@ async def delete_memory(memory_id: int, user: AuthUser = Depends(get_current_use
async with pool.acquire() as conn:
row = await conn.fetchrow(
"SELECT id, vault_path FROM memories WHERE id = $1 AND user_id = $2",
"SELECT id, vault_path, substr(content, 1, 50) AS preview FROM memories WHERE id = $1 AND user_id = $2",
memory_id,
user.user_id,
)
@ -216,7 +216,7 @@ async def delete_memory(memory_id: int, user: AuthUser = Depends(get_current_use
user.user_id,
)
return {"deleted": memory_id}
return {"deleted": memory_id, "preview": row["preview"]}
@app.post("/api/memories/{memory_id}/secret", response_model=SecretResponse)