feat: add plan title and interval editing to settings

- Add Settings button label i18n (de: Einstellungen)
- Allow editing plan title, feeding per day, feeding interval, and litter interval
- Update PlanSettings component with new form fields
- Add German and English translations for new settings
- Update Plan type to include title property
This commit is contained in:
2026-01-12 23:49:17 +01:00
parent e395f2a8b1
commit 8854cfd1f9
5 changed files with 113 additions and 2 deletions

View File

@@ -32,6 +32,7 @@ type Booking = {
type Plan = {
id: string
title: string
startDate: Date
endDate: Date
instructions: string | null
@@ -161,9 +162,13 @@ export function PlanDashboard({ plan, dict, settingsDict, lang }: PlanDashboardP
</Button>
<PlanSettings
planId={plan.id}
initialTitle={plan.title}
initialWebhookUrl={plan.webhookUrl}
initialInstructions={plan.instructions}
initialNotifyAll={plan.notifyAll}
initialFeedingPerDay={plan.feedingPerDay}
initialFeedingInterval={plan.feedingInterval}
initialLitterInterval={plan.litterInterval}
dict={settingsDict}
lang={lang}
/>

View File

@@ -8,7 +8,15 @@ import { getDictionary } from "@/get-dictionary"
export async function updatePlan(
planId: string,
data: { instructions?: string; webhookUrl?: string; notifyAll?: boolean },
data: {
instructions?: string;
webhookUrl?: string;
notifyAll?: boolean;
title?: string;
feedingPerDay?: number;
feedingInterval?: number;
litterInterval?: number;
},
lang: string = "en"
) {
const dict = await getDictionary(lang as any)
@@ -19,6 +27,10 @@ export async function updatePlan(
instructions: data.instructions,
webhookUrl: data.webhookUrl,
notifyAll: data.notifyAll,
title: data.title,
feedingPerDay: data.feedingPerDay,
feedingInterval: data.feedingInterval,
litterInterval: data.litterInterval,
}
})