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:
@@ -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}
|
||||
/>
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user