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,45 @@
import { createNewsletterApi } from '@kit/newsletter/api';
import { CreateNewsletterForm } from '@kit/newsletter/components';
import { getSupabaseServerClient } from '@kit/supabase/server-client';
import { AccountNotFound } from '~/components/account-not-found';
import { CmsPageShell } from '~/components/cms-page-shell';
interface Props {
params: Promise<{ account: string; campaignId: string }>;
}
export default async function EditNewsletterPage({ params }: Props) {
const { account, campaignId } = await params;
const client = getSupabaseServerClient();
const { data: acct } = await client
.from('accounts')
.select('id')
.eq('slug', account)
.single();
if (!acct) return <AccountNotFound />;
const api = createNewsletterApi(client);
const newsletter = await api.getNewsletter(campaignId);
if (!newsletter) return <AccountNotFound />;
const n = newsletter as Record<string, unknown>;
return (
<CmsPageShell account={account} title="Newsletter bearbeiten">
<CreateNewsletterForm
accountId={acct.id}
account={account}
newsletterId={campaignId}
initialData={{
subject: String(n.subject ?? ''),
bodyHtml: String(n.body_html ?? ''),
bodyText: String(n.body_text ?? ''),
scheduledAt: String(n.scheduled_at ?? ''),
}}
/>
</CmsPageShell>
);
}