mirror of
https://github.com/R0m1k3/PleinR.git
synced 2026-10-16 11:46:44 +02:00
Corrige la suppression d'adhérent (FK) et intègre le vrai logo
- deleteMember: supprime d'abord les promotions liées et détache les comptes utilisateurs (transaction) avant de supprimer l'adhérent, ce qui évite la violation de clé étrangère (erreur serveur au clic « Supprimer »). - Logo: remplace le SVG provisoire par le logo officiel (public/assets/logo.png) et met à jour toutes les références (accueil, login, backend, favicon). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XwfhYHzC9hQWPDnQ2p53GL
This commit is contained in:
7 files changed
+13
-54
No files matched your search
@@ -76,7 +76,7 @@ export function BackendShell({
|
||||
<div style={{ display: "flex", alignItems: "center", gap: 11, padding: "6px 8px 22px" }}>
|
||||
<span style={{ display: "inline-flex", background: "#F6F2E8", borderRadius: 11, padding: 6 }}>
|
||||
{/* eslint-disable-next-line @next/next/no-img-element */}
|
||||
<img src="/assets/logo.svg" alt="Plein R" style={{ height: 34, width: "auto", display: "block" }} />
|
||||
<img src="/assets/logo.png" alt="Plein R" style={{ height: 34, width: "auto", display: "block" }} />
|
||||
</span>
|
||||
<div>
|
||||
<div className="font-display" style={{ fontWeight: 800, fontSize: 17, color: "#fff", lineHeight: 1 }}>
|
||||
|
||||
@@ -129,7 +129,13 @@ export async function deleteMember(formData: FormData) {
|
||||
if (!can(role, "manageMembers")) throw new Error("Accès refusé");
|
||||
const id = Number(formData.get("id"));
|
||||
if (!id) return;
|
||||
await db.delete(members).where(eq(members.id, id));
|
||||
// Remove dependent rows first to satisfy foreign-key constraints:
|
||||
// delete the member's promotions and detach any linked user account.
|
||||
await db.transaction(async (tx) => {
|
||||
await tx.delete(promotions).where(eq(promotions.memberId, id));
|
||||
await tx.update(users).set({ memberId: null }).where(eq(users.memberId, id));
|
||||
await tx.delete(members).where(eq(members.id, id));
|
||||
});
|
||||
revalidatePath("/backend/adherents");
|
||||
revalidatePath("/");
|
||||
}
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ export default function RootLayout({
|
||||
href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,400;12..96,600;12..96,700;12..96,800&family=Public+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap"
|
||||
rel="stylesheet"
|
||||
/>
|
||||
<link rel="icon" href="/assets/logo.svg" type="image/svg+xml" />
|
||||
<link rel="icon" href="/assets/logo.png" type="image/png" />
|
||||
</head>
|
||||
<body>{children}</body>
|
||||
</html>
|
||||
|
||||
@@ -25,7 +25,7 @@ export default function LoginPage() {
|
||||
<div style={{ width: "100%", maxWidth: 420 }}>
|
||||
<div style={{ textAlign: "center", marginBottom: 22 }}>
|
||||
{/* eslint-disable-next-line @next/next/no-img-element */}
|
||||
<img src="/assets/logo.svg" alt="Plein R" style={{ height: 92, width: "auto" }} />
|
||||
<img src="/assets/logo.png" alt="Plein R" style={{ height: 92, width: "auto" }} />
|
||||
</div>
|
||||
|
||||
<div
|
||||
|
||||
+3
-3
@@ -47,7 +47,7 @@ export default async function AccueilPage() {
|
||||
>
|
||||
<Link href="/" style={{ display: "flex", alignItems: "center", gap: 10, textDecoration: "none" }}>
|
||||
{/* eslint-disable-next-line @next/next/no-img-element */}
|
||||
<img src="/assets/logo.svg" alt="Plein R" style={{ height: 44, width: "auto" }} />
|
||||
<img src="/assets/logo.png" alt="Plein R" style={{ height: 44, width: "auto" }} />
|
||||
<span className="font-display" style={{ fontWeight: 800, fontSize: 20, color: "#13324F" }}>
|
||||
Plein R
|
||||
</span>
|
||||
@@ -96,7 +96,7 @@ export default async function AccueilPage() {
|
||||
<div style={{ display: "flex", justifyContent: "center", alignItems: "center" }}>
|
||||
{/* eslint-disable-next-line @next/next/no-img-element */}
|
||||
<img
|
||||
src="/assets/logo.svg"
|
||||
src="/assets/logo.png"
|
||||
alt="Plein R — Association des commerçants et entreprises du Bassin de Pompey"
|
||||
className="floatlogo"
|
||||
style={{
|
||||
@@ -571,7 +571,7 @@ export default async function AccueilPage() {
|
||||
>
|
||||
<div style={{ display: "flex", alignItems: "center", gap: 10 }}>
|
||||
{/* eslint-disable-next-line @next/next/no-img-element */}
|
||||
<img src="/assets/logo.svg" alt="Plein R" style={{ height: 36, width: "auto" }} />
|
||||
<img src="/assets/logo.png" alt="Plein R" style={{ height: 36, width: "auto" }} />
|
||||
<span className="font-display" style={{ fontWeight: 800, fontSize: 16, color: "#13324F" }}>
|
||||
Plein R
|
||||
</span>
|
||||
|
||||
Reference in new issue
Block a user