Add full editing for client proofing links

This commit is contained in:
2026-10-04 18:16:03 +03:00
parent fe4c716aa8
commit 2e6f027b71
3 changed files with 245 additions and 3 deletions

View File

@@ -39,8 +39,19 @@ export const PATCH = withAdmin(async (request: NextRequest, { params }: Context)
const album = await immich.getProofingAlbum(session.albumId).catch(() => null);
return NextResponse.json({ session: toAdminSession(session, album) });
} catch (err) {
if (err instanceof ProofError)
return NextResponse.json({ error: err.message }, { status: 404 });
if (err instanceof ProofError) {
return NextResponse.json(
{ error: err.message },
{
status:
err.code === 'alias-taken'
? 409
: err.code === 'not-found'
? 404
: 400,
},
);
}
throw err;
}
});