Add API endpoint to delete private notes#261
Add API endpoint to delete private notes#261josephsellers wants to merge 2 commits intoabhinavxd:mainfrom
Conversation
Adds DELETE /api/v1/conversations/{cuuid}/messages/{uuid} for removing
private notes via the API. Only messages with private=true can be
deleted — the SQL WHERE clause ensures sent messages are protected.
Returns 404 if the message doesn't exist or isn't private.
Useful for API consumers that create private notes programmatically
and need to clean them up (e.g. replacing an outdated note before
adding a new one).
[Used Claude Code 🤖]
|
Thanks for the PR! We should have a context menu option (right click on private note) to delete it that hits this API. |
Right-clicking a private note shows a "Delete note" option that calls the DELETE endpoint and removes the note from the UI. Non-private messages are unaffected (browser default context menu). [Used Claude Code 🤖]
|
Added a context menu for private notes in the conversation view. Right-clicking a private note shows a "Delete note" option (with trash icon, destructive styling). Non-private messages are unaffected. Changes:
|
|
P.S. Sorry for the big diff on MessageBubble.vue. I think the logic is sound, but the indentation changed making a 15 line change look massive. |
|
Hey, thanks for the PR! I will merge this as soon as I merge - #114 #114 PR adds the live chat widget, which required me to refactor and move many parts of the project. Since everything would need to be retested anyway, I ended up bundling in a lot of other fixes as well to avoid multiple rounds of QA. |
|
Hey there seems to be conflict due to recent live chat branch merge |
Summary
Adds
DELETE /api/v1/conversations/{cuuid}/messages/{uuid}for removing private notes via the API. Only messages withprivate=truecan be deleted; the SQL WHERE clause ensures sent messages are protected. Returns 404 if the message doesn't exist or isn't private.This is useful for API consumers that create private notes programmatically and need to clean them up (e.g. replacing an outdated note before adding a new one).
Changes
cmd/messages_delete.go: New handler (handleDeleteMessage) with conversation access enforcementinternal/conversation/message_delete.go: NewDeleteMessagemethod on the conversation managercmd/handlers.go: Route registration (DELETE,messages:writepermission)internal/conversation/conversation.go:DeleteMessageprepared statement in query structinternal/conversation/queries.sql:delete-messagequeryTest plan
POST /conversations/{uuid}/messageswithprivate: trueDELETE /conversations/{cuuid}/messages/{uuid}