fix: link album assignment and narrow errors

This commit is contained in:
Leon Tonhäuser committed 2026-08-09 22:06:34 +02:00
1 parent 4af86f6eb9
commit f6e6018cc1
5 files changed
+123 -42

No files matched your search

@@ -8,6 +8,7 @@ import { editorialAccounts } from "@/db/schema";
import { albumGrantService } from "@/modules/albums/grants";
import { grantAlbumAction, revokeAlbumAction } from "./actions";
import { loadAssignableAlbums } from "./page-content";
export default async function EditorialAlbumsPage({
params,
@@ -22,10 +23,7 @@ export default async function EditorialAlbumsPage({
notFound();
}
const albumResult = await albumGrantService
.listAssignableAlbums(editorial.id)
.then((albums) => ({ albums, unavailable: false }))
.catch(() => ({ albums: [], unavailable: true }));
const albumResult = await loadAssignableAlbums(editorial.id, albumGrantService);
if (albumResult.unavailable) {
return (