feat: delete dogs + PawPrint nav icon #35

Merged
jason merged 3 commits from feat/dog-delete-nav-icon into master 2026-03-09 22:59:44 -05:00
Owner

Summary

🗑️ Delete Dogs

  • Backend: DELETE /api/dogs/:id — hard delete with full cascade cleanup:
    • Removes all parents rows where dog is child or parent
    • Removes health_records and heat_cycles for the dog
    • Removes the dog record itself
    • Returns { success: true, message: '<name> has been deleted' }
    • Photo files on disk are preserved (garbage collect separately if needed)
  • Frontend: Trash icon button on each dog card in DogList
    • Red hover state with border highlight
    • Triggers a centered blur-backdrop confirmation modal
    • Modal shows dog name, warns about permanent removal, Cancel / Yes Delete buttons
    • On confirm: calls API, removes dog from local state instantly (optimistic)

🐾 Nav Icon

  • Swapped UsersPawPrint for the Dogs nav link in App.jsx

Files Changed

  • server/routes/dogs.js — replaced soft-delete (is_active=0) with hard DELETE cascade
  • client/src/pages/DogList.jsx — delete button + confirmation modal
  • client/src/App.jsx — Dogs nav icon updated to PawPrint
## Summary ### 🗑️ Delete Dogs - **Backend**: `DELETE /api/dogs/:id` — hard delete with full cascade cleanup: - Removes all `parents` rows where dog is child or parent - Removes `health_records` and `heat_cycles` for the dog - Removes the dog record itself - Returns `{ success: true, message: '<name> has been deleted' }` - Photo files on disk are preserved (garbage collect separately if needed) - **Frontend**: Trash icon button on each dog card in `DogList` - Red hover state with border highlight - Triggers a centered blur-backdrop confirmation modal - Modal shows dog name, warns about permanent removal, Cancel / Yes Delete buttons - On confirm: calls API, removes dog from local state instantly (optimistic) ### 🐾 Nav Icon - Swapped `Users` → `PawPrint` for the **Dogs** nav link in `App.jsx` ## Files Changed - `server/routes/dogs.js` — replaced soft-delete (`is_active=0`) with hard DELETE cascade - `client/src/pages/DogList.jsx` — delete button + confirmation modal - `client/src/App.jsx` — Dogs nav icon updated to `PawPrint`
jason added 3 commits 2026-03-09 22:59:22 -05:00
jason merged commit cf2a5ba8d3 into master 2026-03-09 22:59:44 -05:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: jason/breedr#35