feat(housekeeping): deliver economy vertical
CI / check (pull_request) Successful in 40s
CI / release (pull_request) Skipped
CI / deploy (pull_request) Skipped

This commit is contained in:
Simo committed 2026-08-30 13:47:06 +02:00
1 parent 1ec05cda39
commit 9c4b973faf
62 files changed
+6306 -1285

No files matched your search

+12 -16
View File
@@ -1,34 +1,30 @@
"use server";
import { eq } from "drizzle-orm";
import { revalidatePath } from "next/cache";
import { executeLegacyEconomyMutation } from "@/features/housekeeping/domains/economy/services/mutations";
import { requirePermission } from "@/lib/admin/guard";
import { db, Soundtracks } from "@/lib/db";
import { PERMS } from "@/lib/permissions";
export async function deleteSoundtrack({ id }: { id: number }) {
await requirePermission(PERMS.CATALOG_EDIT);
await db.delete(Soundtracks).where(eq(Soundtracks.id, id));
const staff = await requirePermission(PERMS.CATALOG_EDIT);
await executeLegacyEconomyMutation(staff, "soundtrack.change", {
action: "delete",
id,
});
revalidatePath("/admin/sounds");
}
export async function updateSoundtrack({
id,
name,
author,
track,
length,
}: {
export async function updateSoundtrack(input: {
id: number;
name: string;
author: string;
track: string;
length: number;
}) {
await requirePermission(PERMS.CATALOG_EDIT);
await db
.update(Soundtracks)
.set({ name, author, track, length })
.where(eq(Soundtracks.id, id));
const staff = await requirePermission(PERMS.CATALOG_EDIT);
await executeLegacyEconomyMutation(staff, "soundtrack.change", {
action: "update",
...input,
});
revalidatePath("/admin/sounds");
}