Skip to content

feat: add delete_conversation and delete_project REST API endpoints#194

Merged
mike1858 merged 1 commit intomainfrom
Fix-Web-Routes
Mar 8, 2026
Merged

feat: add delete_conversation and delete_project REST API endpoints#194
mike1858 merged 1 commit intomainfrom
Fix-Web-Routes

Conversation

@mike1858
Copy link
Copy Markdown
Member

@mike1858 mike1858 commented Mar 8, 2026

Summary

Fixes #193Delete discussion not working in web mode.

Both delete_conversation and delete_project were available as Tauri commands (desktop mode) but had no corresponding Rocket route handlers in the web server, causing these operations to fail in web mode.

Changes

Single file modified: crates/server/src/main.rs (+33 lines, -1 line)

  • Import Rocket's delete macro for HTTP DELETE route support
  • Add DELETE /api/conversations/<chat_id> endpoint with URL decoding (matches apiClient.delete() in webApi.ts)
  • Add POST /api/delete-project endpoint with DeleteProjectRequest struct (matches apiClient.post() in webApi.ts)
  • Register both new routes in the Rocket mount configuration

How It Was Broken

Layer delete_conversation delete_project
Frontend UI ProjectDetail.tsx Projects.tsx
API Interface api.ts api.ts
Web API client webApi.ts (DELETE) webApi.ts (POST)
Rocket Server Missing Missing
Backend Core backend/lib.rs backend/lib.rs
Tauri Command commands/mod.rs commands/mod.rs

The frontend, API interface, web API client, and backend logic all existed — only the Rocket HTTP route handlers were missing, breaking the bridge in web mode.

Verification

  • cargo build --workspace — ✅ clean
  • cargo clippy --package server -- -D warnings — ✅ zero warnings
  • Manually tested — ✅ conversation deleted successfully

Summary by CodeRabbit

  • New Features
    • Users can now delete individual conversations.
    • Users can now delete projects.

Fixes #193 - Delete discussion not working in web mode.

Both delete_conversation and delete_project were available as Tauri
commands (desktop mode) but had no corresponding Rocket route handlers
in the web server, causing these operations to fail silently in web mode.

Changes:
- Import Rocket's delete macro for HTTP DELETE route support
- Add DELETE /api/conversations/<chat_id> endpoint with URL decoding
- Add POST /api/delete-project endpoint with DeleteProjectRequest struct
- Register both new routes in the Rocket mount configuration
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 8, 2026

📝 Walkthrough

Walkthrough

Two new API endpoints were added to enable conversation and project deletion via REST API. The DELETE /conversations/<chat_id> endpoint deletes conversations by ID, and the POST /delete-project endpoint removes projects using a project_id from the request body. Route registration was updated in the Rocket framework configuration.

Changes

Cohort / File(s) Summary
New Delete Endpoints
crates/server/src/main.rs
Added two new handler functions: delete_conversation() for removing conversations by chat_id and delete_project() for removing projects. Updated Rocket imports to include delete route qualifier and registered both endpoints in the API route set.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 Hop hop, the endpoints are here,
Conversations and projects disappear!
Delete with a bounce, no traces remain,
The API grows strong with each new refrain. 🗑️

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely summarizes the main changes: adding two new REST API endpoints for deleting conversations and projects.
Linked Issues check ✅ Passed The PR successfully implements the primary objective from issue #193 by adding the DELETE /conversations/<chat_id> endpoint required for discussion deletion in REST API.
Out of Scope Changes check ✅ Passed The PR includes a delete_project endpoint not mentioned in the linked issue #193, but the scope appears reasonable as a related deletion feature for the same system.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch Fix-Web-Routes

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@mike1858 mike1858 requested a review from georpar March 8, 2026 14:31
@mike1858 mike1858 merged commit c620210 into main Mar 8, 2026
2 checks passed
@mike1858 mike1858 deleted the Fix-Web-Routes branch March 8, 2026 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Delete discussion not work

2 participants