From 46453604ac614a24866a06e0376cb083d6500080 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C9=A7=CF=83=E2=84=93=CF=83?= Date: Tue, 2 Jun 2026 18:16:21 +0200 Subject: [PATCH] refactor: rebrand application from Paulin & Agathe to Vincent & Antoine and update API endpoint to July webhook --- index.html | 2 +- package-lock.json | 2 - src/App.jsx | 4 +- src/api.js | 2 +- src/components/AppartCard.jsx | 69 ++++++++++++++++----------------- src/components/PasswordGate.jsx | 2 +- 6 files changed, 39 insertions(+), 42 deletions(-) diff --git a/index.html b/index.html index 5a255c7..7ed50ee 100644 --- a/index.html +++ b/index.html @@ -2,7 +2,7 @@ - + Appart List diff --git a/package-lock.json b/package-lock.json index b165ee0..9ca32a6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2525,7 +2525,6 @@ "integrity": "sha512-ekilCSN1jwRvIbgeg/57YFh8qQDNbwDb9xT/qu2DAHbFFZUicIl4ygVaAvzveMhMVr3LnpSKTNnwt8PoOfmKhQ==", "dev": true, "license": "MIT", - "peer": true, "bin": { "jiti": "lib/jiti-cli.mjs" } @@ -2627,7 +2626,6 @@ "integrity": "sha512-utfs7Pr5uJyyvDETitgsaqSyjCb2qNRAtuqUeWIAKztsOYdcACf2KtARYXg2pSvhkt+9NfoaNY7fxjl6nuMjIQ==", "dev": true, "license": "MPL-2.0", - "peer": true, "dependencies": { "detect-libc": "^2.0.3" }, diff --git a/src/App.jsx b/src/App.jsx index 4aa932b..6ffbb44 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -199,7 +199,7 @@ function App() { case "note_desc": list.sort( (a, b) => - (b.NOTE_P || 0) + (b.NOTE_A || 0) - ((a.NOTE_P || 0) + (a.NOTE_A || 0)) + (b.NOTE_V || 0) + (b.NOTE_A || 0) - ((a.NOTE_V || 0) + (a.NOTE_A || 0)) ); break; case "recent": @@ -248,7 +248,7 @@ function App() { Appart Nantes

- Paulin & Agathe + Vincent & Antoine {stats && ( -- {stats.count} annonce{stats.count > 1 ? "s" : ""} | moy.{" "} diff --git a/src/api.js b/src/api.js index da6c2a6..ebd6d13 100644 --- a/src/api.js +++ b/src/api.js @@ -1,4 +1,4 @@ -const BASE = "https://n8n.holo795.fr/webhook/annonce_appart"; +const BASE = "https://n8n.holo795.fr/webhook/annonce_appart_july"; export async function fetchAnnonces() { const res = await fetch(`${BASE}/get`); diff --git a/src/components/AppartCard.jsx b/src/components/AppartCard.jsx index 940b66e..4e067c4 100644 --- a/src/components/AppartCard.jsx +++ b/src/components/AppartCard.jsx @@ -4,8 +4,6 @@ import { Euro, Maximize2, DoorOpen, - Bus, - Car, Calendar, Sofa, ParkingCircle, @@ -92,17 +90,17 @@ const formatFrDate = (value) => { }); }; -const normalizeFeedback = (noteP, noteA, commentP, commentA) => ({ - NOTE_P: typeof noteP === "number" ? noteP : parseFloat(noteP) || 0, +const normalizeFeedback = (noteV, noteA, commentV, commentA) => ({ + NOTE_V: typeof noteV === "number" ? noteV : parseFloat(noteV) || 0, NOTE_A: typeof noteA === "number" ? noteA : parseFloat(noteA) || 0, - COMMENTAIRE_P: commentP?.trim() ? commentP.trim() : null, + COMMENTAIRE_V: commentV?.trim() ? commentV.trim() : null, COMMENTAIRE_A: commentA?.trim() ? commentA.trim() : null, }); export default function AppartCard({ annonce, onDelete, onUpdated }) { - const [noteP, setNoteP] = useState(annonce.NOTE_P || 0); + const [noteV, setNoteV] = useState(annonce.NOTE_V || 0); const [noteA, setNoteA] = useState(annonce.NOTE_A || 0); - const [commentP, setCommentP] = useState(annonce.COMMENTAIRE_P || ""); + const [commentV, setCommentV] = useState(annonce.COMMENTAIRE_V || ""); const [commentA, setCommentA] = useState(annonce.COMMENTAIRE_A || ""); const [saving, setSaving] = useState(false); const [pendingSave, setPendingSave] = useState(false); @@ -110,20 +108,20 @@ export default function AppartCard({ annonce, onDelete, onUpdated }) { const [deleting, setDeleting] = useState(false); const lastSavedRef = useRef( - normalizeFeedback(noteP, noteA, commentP, commentA) + normalizeFeedback(noteV, noteA, commentV, commentA) ); - const hasPaulinFeedback = (noteP ?? 0) > 0 || !!commentP?.trim(); - const hasAgatheFeedback = (noteA ?? 0) > 0 || !!commentA?.trim(); + const hasVincentFeedback = (noteV ?? 0) > 0 || !!commentV?.trim(); + const hasAntoineFeedback = (noteA ?? 0) > 0 || !!commentA?.trim(); useEffect(() => { - const normalized = normalizeFeedback(noteP, noteA, commentP, commentA); + const normalized = normalizeFeedback(noteV, noteA, commentV, commentA); const lastSaved = lastSavedRef.current; if ( - normalized.NOTE_P === lastSaved.NOTE_P && + normalized.NOTE_V === lastSaved.NOTE_V && normalized.NOTE_A === lastSaved.NOTE_A && - normalized.COMMENTAIRE_P === lastSaved.COMMENTAIRE_P && + normalized.COMMENTAIRE_V === lastSaved.COMMENTAIRE_V && normalized.COMMENTAIRE_A === lastSaved.COMMENTAIRE_A ) { return; @@ -147,14 +145,14 @@ export default function AppartCard({ annonce, onDelete, onUpdated }) { }, 700); return () => clearTimeout(timeout); - }, [annonce.id, commentA, commentP, noteA, noteP, onUpdated]); + }, [annonce.id, commentA, commentV, noteA, noteV, onUpdated]); const handleSave = async () => { setSaving(true); await updateAnnonce(annonce.id, { - NOTE_P: noteP, + NOTE_V: noteV, NOTE_A: noteA, - COMMENTAIRE_P: commentP || null, + COMMENTAIRE_V: commentV || null, COMMENTAIRE_A: commentA || null, }); onUpdated?.(); @@ -168,7 +166,7 @@ export default function AppartCard({ annonce, onDelete, onUpdated }) { setDeleting(false); }; - const avgNote = noteP || noteA ? ((noteP + noteA) / (noteP && noteA ? 2 : 1)).toFixed(1) : null; + const avgNote = noteV || noteA ? ((noteV + noteA) / (noteV && noteA ? 2 : 1)).toFixed(1) : null; const dateDispo = formatFrDate(annonce.DATE_DISPO); const dateAjout = formatFrDate(annonce.createdAt); @@ -228,11 +226,12 @@ export default function AppartCard({ annonce, onDelete, onUpdated }) {

1 ? "s" : ""}`} /> - {annonce.DISTANCE_V > 0 && ( - - )} - {annonce.DISTANCE_S > 0 && ( - + {annonce.ARRONDISSEMENT && ( + )} {dateDispo && } {dateAjout && } @@ -254,14 +253,14 @@ export default function AppartCard({ annonce, onDelete, onUpdated }) { Notes et commentaires - {(hasPaulinFeedback || hasAgatheFeedback) && ( + {(hasVincentFeedback || hasAntoineFeedback) && ( - {hasPaulinFeedback && ( + {hasVincentFeedback && ( - P + V )} - {hasAgatheFeedback && ( + {hasAntoineFeedback && ( A @@ -280,35 +279,35 @@ export default function AppartCard({ annonce, onDelete, onUpdated }) { {expanded && (
- {/* Paulin */} + {/* Vincent */}
- Paulin + Vincent - +