feat: complete daily checkbox actions and cleanup

- Marked all daily checkbox actions as complete in TODO.md.
- Removed outdated mutation methods from `daily-client.ts`, now managed by server actions in `actions/daily.ts`.
- Deleted unused API routes for checkbox management, streamlining the codebase.
- Updated `useDaily.ts` to utilize server actions with `useTransition`, enhancing performance and user experience.
This commit is contained in:
Julien Froidefond
2025-09-18 13:20:44 +02:00
parent 6135fd8cb1
commit 3ce7af043c
6 changed files with 413 additions and 387 deletions

20
TODO.md
View File

@@ -176,16 +176,16 @@
- [x] **Nettoyage** : Modifier `useTasks.ts` pour remplacer mutations par server actions
#### Actions Daily (Priorité 2)
- [ ] Créer `actions/daily.ts` pour les checkboxes
- [ ] `toggleCheckbox(checkboxId)` - Toggle état checkbox
- [ ] `addCheckboxToDaily(dailyId, content)` - Ajouter checkbox
- [ ] `updateCheckboxContent(checkboxId, content)` - Éditer contenu
- [ ] `deleteCheckbox(checkboxId)` - Supprimer checkbox
- [ ] `reorderCheckboxes(dailyId, checkboxIds)` - Réorganiser
- [ ] Modifier les composants Daily pour utiliser server actions
- [ ] **Nettoyage** : Supprimer routes `/api/daily/checkboxes` (POST, PATCH, DELETE)
- [ ] **Nettoyage** : Simplifier `daily-client.ts` (garder GET uniquement)
- [ ] **Nettoyage** : Modifier composants Daily pour `useTransition`
- [x] Créer `actions/daily.ts` pour les checkboxes
- [x] `toggleCheckbox(checkboxId)` - Toggle état checkbox
- [x] `addCheckboxToDaily(dailyId, content)` - Ajouter checkbox
- [x] `updateCheckboxContent(checkboxId, content)` - Éditer contenu
- [x] `deleteCheckbox(checkboxId)` - Supprimer checkbox
- [x] `reorderCheckboxes(dailyId, checkboxIds)` - Réorganiser
- [x] Modifier les composants Daily pour utiliser server actions
- [x] **Nettoyage** : Supprimer routes `/api/daily/checkboxes` (POST, PATCH, DELETE)
- [x] **Nettoyage** : Simplifier `daily-client.ts` (garder GET uniquement)
- [x] **Nettoyage** : Modifier hook `useDaily.ts` pour `useTransition`
#### Actions User Preferences (Priorité 3)
- [x] Créer `actions/preferences.ts` pour les toggles