| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Implement RenamePost method that atomically:
1. Fetches the post record by old slug
2. Inserts a new record with the new slug
3. Deletes the old slug post
4. Collapses redirect chains (updates any redirects pointing to oldSlug to point to newSlug)
5. Creates a redirect from oldSlug to newSlug
All operations are transactional (all-or-nothing). Includes two comprehensive tests:
- TestRenamePost: basic rename with redirect creation and old slug deletion
- TestRenamePost_CollapsesChain: verifies redirect chains are collapsed correctly
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|