Add Docker support and notification URL enhancement

This commit is contained in:
2026-01-12 20:59:03 +01:00
parent 3121ef223d
commit 68d0584917
5 changed files with 79 additions and 4 deletions

View File

@@ -2,6 +2,7 @@
import prisma from "@/lib/prisma"
import { revalidatePath } from "next/cache"
import { headers } from "next/headers"
import { sendNotification } from "@/lib/notifications"
export async function updatePlan(planId: string, data: { instructions?: string; webhookUrl?: string; notifyAll?: boolean }) {
@@ -15,7 +16,10 @@ export async function updatePlan(planId: string, data: { instructions?: string;
})
if (data.instructions && plan.webhookUrl && plan.notifyAll) {
await sendNotification(plan.webhookUrl, `📝 UPDATED: Cat instructions have been modified.`)
const host = (await headers()).get("host")
const protocol = host?.includes("localhost") ? "http" : "https"
const planUrl = `${protocol}://${host}/dashboard/${planId}`
await sendNotification(plan.webhookUrl, `📝 UPDATED: Cat instructions have been modified.\nPlan: ${planUrl}`)
}
revalidatePath(`/dashboard/${planId}`)