Inscription : magasin en brouillon → page « indisponible » au lieu d'un 404

L'affichette peut être imprimée avant l'activation du magasin.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Tony AVERTY 2026-10-06 14:28:18 +02:00
parent dd70cb052a
commit f844048777
4 changed files with 3 additions and 1 deletions

1
.gitignore vendored
View file

@ -16,3 +16,4 @@ backend/DEPLOY
backend/ROLLBACK backend/ROLLBACK
backend/RESTART backend/RESTART
backend/.env.production backend/.env.production
init-production.sql

BIN
admin/si.zip Normal file

Binary file not shown.

BIN
backend/backen.zip Normal file

Binary file not shown.

View file

@ -55,7 +55,8 @@ export class EnrollmentPagesController {
@Get('c/:slug') @Get('c/:slug')
async enroll(@Param('slug') slug: string, @Res() res: Response) { async enroll(@Param('slug') slug: string, @Res() res: Response) {
const store = await this.enrollment.findStore(slug); const store = await this.enrollment.findStore(slug);
if (!store || store.status === 'DRAFT') return html(res, notFoundPage(), 404); // Brouillon : l'affichette peut déjà être imprimée, on affiche « indisponible » plutôt qu'un 404.
if (!store) return html(res, notFoundPage(), 404);
if (store.status !== 'ACTIVE' || !store.cardDesign) return html(res, unavailablePage(store)); if (store.status !== 'ACTIVE' || !store.cardDesign) return html(res, unavailablePage(store));
html(res, enrollPage(store)); html(res, enrollPage(store));
} }