feat: add delete functionality for leases, catch books, and permits; implement newsletter update feature
Some checks failed
Workflow / ʦ TypeScript (push) Failing after 4m52s
Workflow / ⚫️ Test (push) Has been skipped

This commit is contained in:
T. Zehetbauer
2026-04-01 17:53:39 +02:00
parent c6b2824da8
commit 080ec1cb47
22 changed files with 798 additions and 210 deletions

View File

@@ -0,0 +1,49 @@
import { getSupabaseServerClient } from '@kit/supabase/server-client';
import { createVerbandApi } from '@kit/verbandsverwaltung/api';
import {
VerbandTabNavigation,
CreateClubForm,
} from '@kit/verbandsverwaltung/components';
import { AccountNotFound } from '~/components/account-not-found';
import { CmsPageShell } from '~/components/cms-page-shell';
interface Props {
params: Promise<{ account: string; clubId: string }>;
}
export default async function EditClubPage({ params }: Props) {
const { account, clubId } = await params;
const client = getSupabaseServerClient();
const { data: acct } = await client
.from('accounts')
.select('id')
.eq('slug', account)
.single();
if (!acct) return <AccountNotFound />;
const api = createVerbandApi(client);
const [club, types] = await Promise.all([
api.getClub(clubId),
api.listTypes(acct.id),
]);
if (!club) return <AccountNotFound />;
return (
<CmsPageShell
account={account}
title={`${String((club as Record<string, unknown>).name)} — Bearbeiten`}
>
<VerbandTabNavigation account={account} activeTab="clubs" />
<CreateClubForm
accountId={acct.id}
account={account}
types={types.map((t) => ({ id: t.id, name: t.name }))}
club={club as Record<string, unknown>}
/>
</CmsPageShell>
);
}

View File

@@ -1,4 +1,9 @@
import Link from 'next/link';
import { Pencil } from 'lucide-react';
import { getSupabaseServerClient } from '@kit/supabase/server-client';
import { Button } from '@kit/ui/button';
import { createVerbandApi } from '@kit/verbandsverwaltung/api';
import {
VerbandTabNavigation,
@@ -64,6 +69,12 @@ export default async function ClubDetailPage({ params }: Props) {
)}
</div>
</div>
<Button asChild variant="outline" size="sm">
<Link href={`/home/${account}/verband/clubs/${clubId}/edit`}>
<Pencil className="mr-2 h-4 w-4" />
Bearbeiten
</Link>
</Button>
</div>
{/* Contacts */}