Add full editing for client proofing links
This commit is contained in:
@@ -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;
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user