🐛(backend) Prevent moving document to its own descendant or self#2208
🐛(backend) Prevent moving document to its own descendant or self#2208maboukerfa wants to merge 1 commit intosuitenumerique:mainfrom
Conversation
When attempting to move a document to itself or to any of its descendants, the server would crash with a 500 Internal Server Error. Signed-off-by: Mohamed El Amine BOUKERFA <boukerfa.ma@gmail.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughThe changes add exception handling for document movement operations within a tree hierarchy. The backend API endpoint for moving documents now catches Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Purpose
When attempting to move a document to itself or to any of its descendants, the server would crash with a 500 Internal Server Error.
Proposal
Handling the exception and returning a 400 Bad Request instead of a 500 Internal Server Error.
Before
After