Header menu via header.js

This commit is contained in:
karim hassan
2025-08-24 23:47:39 +00:00
parent f1103d67a0
commit eabd0aa50f
25 changed files with 869 additions and 185 deletions

View File

@@ -0,0 +1,34 @@
Super Sunday — API patch: DELETE /api/tournaments/:id (+GET/POST)
================================================================
Ce patch ajoute la route **DELETE /api/tournaments/:id** (et fournit GET/POST
si besoin) côté backend Node/Express, sans rien changer au Dockerfile.
Fichiers ajoutés/mis-à-jour
---------------------------
- backend/src/db.js (connexion PG via env)
- backend/src/routes/tournaments.js (GET, POST, DELETE)
- backend/src/index.js (monte /api/tournaments + /api/health)
Installation
------------
1) Dézipper à la racine du projet :
unzip -o supersunday_api_delete_tournament_patch.zip -d .
2) Rebuild + restart API (pas besoin de toucher à web/nginx) :
docker compose build --no-cache api
docker compose up -d api
docker compose logs --since=1m api
3) Test rapide :
curl -i http://localhost/api/health
curl -s http://localhost/api/tournaments
curl -i -X DELETE http://localhost/api/tournaments/1
Notes
-----
- Si votre schéma na pas de `ON DELETE CASCADE`, le handler supprime dabord
`matches` puis `participants` avant la ligne `tournaments`.
- Les noms de tables supposés : tournaments(id, name, location, start_date, end_date),
participants(tournament_id, full_name), matches(tournament_id, ...).
Adaptez si vos noms différent et relancez.