release: v0.19.0
Release v0.19.0. See the `## [0.19.0] — 2026-09-29` section of [CHANGELOG.md](https://github.com/ralksta/immich-folio/blob/dev/CHANGELOG.md) for the full list. Highlights: client proofing links (#683), custom content pages (#738), asset picker search (#740), concurrent-edit detection (#742), env-locked settings (#739), an accessibility baseline (#741), three security fixes with advisories (#737, #755, #759), and a pre-release quality pass (#780–#797). --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: ralksta <ralksta@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Claude Opus 5 <noreply@anthropic.com> Co-authored-by: Ralf <rohlenbo79@gmail.com> Co-authored-by: Paul Thies <110185070+ImScheinox@users.noreply.github.com> Co-authored-by: lancetm714 <108419425+lancetm714@users.noreply.github.com> Co-authored-by: Lance Martin <lancetaylor95@gmail.com>
This commit is contained in:
44
app/api/proof/[token]/submit/route.ts
Normal file
44
app/api/proof/[token]/submit/route.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
/**
|
||||
* POST /api/proof/:token/submit — lock the client's selection and notify the
|
||||
* photographer.
|
||||
*
|
||||
* Idempotent: submitting twice answers 200 both times, and only the first call
|
||||
* fires the webhook.
|
||||
*/
|
||||
|
||||
import { NextRequest, NextResponse } from 'next/server';
|
||||
import { proofError, resolveProofAccess } from '@/lib/proofAccess';
|
||||
import { ProofError, submitSelection } from '@/lib/proofSessions';
|
||||
import { notifySubmitted } from '@/lib/proofWebhook';
|
||||
import { getConfig } from '@/lib/config';
|
||||
|
||||
export const dynamic = 'force-dynamic';
|
||||
|
||||
const SUBMIT_RPM = 10;
|
||||
|
||||
export async function POST(
|
||||
request: NextRequest,
|
||||
{ params }: { params: Promise<{ token: string }> },
|
||||
) {
|
||||
const { token } = await params;
|
||||
const access = await resolveProofAccess(request, token, 'proof-submit', SUBMIT_RPM);
|
||||
if ('error' in access) return access.error;
|
||||
|
||||
try {
|
||||
const { session, firstSubmit } = await submitSelection(token);
|
||||
if (firstSubmit) {
|
||||
// Not awaited: a slow or broken webhook must not hold up the client.
|
||||
void notifySubmitted(session, access.albumName, getConfig().siteUrl);
|
||||
}
|
||||
return NextResponse.json(
|
||||
{ ok: true, submittedAt: session.submittedAt },
|
||||
{ headers: { 'Cache-Control': 'no-store' } },
|
||||
);
|
||||
} catch (err) {
|
||||
if (err instanceof ProofError && err.code === 'empty') {
|
||||
return proofError(400, 'Nothing selected');
|
||||
}
|
||||
if (err instanceof ProofError) return proofError(404, 'Not found');
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user