feat: add cross-album search, auto-rules, album UI redesign, editorial archiving and pdf download
This commit is contained in:
1 parent
9c0d43b1ec
commit
375e5b8b7d
23 files changed
+1153
-43
No files matched your search
@@ -0,0 +1,40 @@
|
||||
"use server";
|
||||
|
||||
import { revalidatePath } from "next/cache";
|
||||
import { headers } from "next/headers";
|
||||
import { redirect } from "next/navigation";
|
||||
import { requireAdmin } from "@/modules/auth/principal";
|
||||
import { editorialService } from "@/modules/editorials/service";
|
||||
|
||||
export async function archiveEditorialAction(editorialId: string): Promise<void> {
|
||||
const admin = await requireAdmin(new Headers(await headers()));
|
||||
await editorialService.archiveEditorial({
|
||||
editorialId,
|
||||
adminUserId: admin.userId,
|
||||
});
|
||||
revalidatePath(`/admin/redaktionen/${editorialId}`);
|
||||
revalidatePath('/admin/redaktionen');
|
||||
redirect('/admin/redaktionen');
|
||||
}
|
||||
|
||||
export async function suspendEditorialAction(editorialId: string): Promise<void> {
|
||||
const admin = await requireAdmin(new Headers(await headers()));
|
||||
await editorialService.transitionEditorialStatus({
|
||||
editorialId,
|
||||
from: 'active',
|
||||
to: 'suspended',
|
||||
adminUserId: admin.userId,
|
||||
});
|
||||
revalidatePath(`/admin/redaktionen/${editorialId}`);
|
||||
}
|
||||
|
||||
export async function reactivateEditorialAction(editorialId: string): Promise<void> {
|
||||
const admin = await requireAdmin(new Headers(await headers()));
|
||||
await editorialService.transitionEditorialStatus({
|
||||
editorialId,
|
||||
from: 'suspended',
|
||||
to: 'active',
|
||||
adminUserId: admin.userId,
|
||||
});
|
||||
revalidatePath(`/admin/redaktionen/${editorialId}`);
|
||||
}
|
||||
Reference in new issue
Block a user