Add exportPermissions and clean stray untracked src on deploy.
Local Build and Deploy / deploy (push) Successful in 1m13s
Local Build and Deploy / deploy (push) Successful in 1m13s
Co-authored-by: Cursor <[email protected]>
This commit is contained in:
1 parent
9b411e69b4
commit
bb7d581084
2 files changed
+25
No files matched your search
@@ -42,6 +42,8 @@ jobs:
|
||||
# 3. Fetch and update code
|
||||
git fetch origin --prune
|
||||
git reset --hard origin/main
|
||||
# Drop stray untracked sources left on the host (keep secrets/env).
|
||||
git clean -fd -e .env -e .env.local -e .env.production -e .env*.local -- src
|
||||
|
||||
# Preserve .next/cache so Next.js can reuse its incremental build cache.
|
||||
rm -rf .output dist
|
||||
|
||||
@@ -54,3 +54,26 @@ export async function deletePermission(formData: FormData): Promise<void> {
|
||||
|
||||
revalidatePath("/admin/housekeeping");
|
||||
}
|
||||
|
||||
/**
|
||||
* Export housekeeping permissions as plain JSON-serializable rows
|
||||
* (used by the admin export UI).
|
||||
*/
|
||||
export async function exportPermissions(): Promise<
|
||||
{ permission: string; minRank: number; description: string | null }[]
|
||||
> {
|
||||
await requirePermission(PERMS.SETTINGS_VIEW);
|
||||
|
||||
try {
|
||||
return await prisma.websiteHousekeepingPermissions.findMany({
|
||||
orderBy: { permission: "asc" },
|
||||
select: {
|
||||
permission: true,
|
||||
minRank: true,
|
||||
description: true,
|
||||
},
|
||||
});
|
||||
} catch {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user