Add default configuration when webhook table is not found

Fixes an issue where the webhook BAP configuration fails if the `webhook_bap_config` table does not exist in production by returning default values and logging a warning. Includes a SQL script to create the table and a migration entry. Also reorders integrations in `.replit` file.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: cfbfe47c-0c9a-4ebf-8a41-2937407eccff
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/cfbfe47c-0c9a-4ebf-8a41-2937407eccff/DPQVTPV
This commit is contained in:
michaelschal committed 2025-09-03 13:44:29 +00:00
1 parent 98089c6d41
commit bfd1944045
5 files changed
+647 -1

No files matched your search

+14
View File
@@ -88,6 +88,20 @@ export async function registerRoutes(app: Express): Promise<Server> {
} catch (error: any) {
console.error('❌ Erreur récupération config webhook BAP:', error);
// Si la table n'existe pas, retourner une configuration par défaut
if (error.code === '42P01') { // Relation does not exist
console.log('⚠️ Table webhook_bap_config n\'existe pas, retour config par défaut');
return res.json({
id: 1,
name: "Configuration BAP",
webhookUrl: "https://workflow.ffnancy.fr/webhook-test/a3d03176-b72f-412d-8fb9-f920b9fbab4d",
description: "Configuration par défaut (table non créée)",
isActive: true,
needsTableCreation: true
});
}
res.status(500).json({ error: 'Erreur serveur', details: error.message });
}
});