v1 softlaunch
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { notFound, redirect } from "next/navigation";
|
||||
import { auth } from "@/auth";
|
||||
import { db } from "@/lib/db";
|
||||
import {
|
||||
centsToDollars,
|
||||
@@ -9,6 +10,7 @@ import {
|
||||
parseTags,
|
||||
tagsToInputValue,
|
||||
} from "@/lib/forms";
|
||||
import { audit } from "@/lib/audit";
|
||||
import { ServiceForm, type ServiceFormValues } from "../_form";
|
||||
|
||||
export const metadata = { title: "Edit service — TouchBase" };
|
||||
@@ -35,6 +37,14 @@ async function updateService(formData: FormData): Promise<void> {
|
||||
active: parseBool(formData.get("active")),
|
||||
},
|
||||
});
|
||||
const session = await auth();
|
||||
await audit(db, {
|
||||
actorId: session?.user?.id ?? null,
|
||||
action: "service.updated",
|
||||
entityType: "Service",
|
||||
entityId: id,
|
||||
meta: { name },
|
||||
});
|
||||
redirect("/admin/services");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user