From dc4506156c834dd223d29c739716962378f303ec Mon Sep 17 00:00:00 2001 From: Matt Date: Mon, 3 Nov 2025 16:42:10 +0100 Subject: [PATCH] Improve NocoDB configuration logging with specific missing variables and success message --- server/utils/nocodbClient.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/server/utils/nocodbClient.js b/server/utils/nocodbClient.js index aea3659..094d04d 100644 --- a/server/utils/nocodbClient.js +++ b/server/utils/nocodbClient.js @@ -12,8 +12,20 @@ class NocoDBClient { ordersTableId: process.env.NOCODB_ORDERS_TABLE_ID || '', }; - if (!this.config.baseUrl || !this.config.baseId || !this.config.apiKey || !this.config.ordersTableId) { - console.warn('⚠️ NocoDB configuration incomplete. Database integration disabled.'); + // Check configuration completeness + const missingVars = []; + if (!this.config.baseUrl) missingVars.push('NOCODB_BASE_URL'); + if (!this.config.baseId) missingVars.push('NOCODB_BASE_ID'); + if (!this.config.apiKey) missingVars.push('NOCODB_API_KEY'); + if (!this.config.ordersTableId) missingVars.push('NOCODB_ORDERS_TABLE_ID'); + + if (missingVars.length > 0) { + console.warn('⚠️ NocoDB configuration incomplete. Missing variables:', missingVars.join(', ')); + console.warn(' Database integration will be disabled.'); + } else { + console.log('✅ NocoDB client initialized successfully'); + console.log(` Base URL: ${this.config.baseUrl}`); + console.log(` Table ID: ${this.config.ordersTableId}`); } this.baseUrl = `${this.config.baseUrl}/api/v2/tables/${this.config.ordersTableId}/records`;