debug(events): Enhanced field name discovery debugging
Build And Push Image / docker (push) Successful in 3m20s
Details
Build And Push Image / docker (push) Successful in 3m20s
Details
- Added comprehensive logging to identify exact table access issues - Will show actual field names from events table if query succeeds - Will show detailed error information if query fails - This will help identify if issue is field names, permissions, or other factors - Uses emojis for easy log scanning in production
This commit is contained in:
parent
d01758b947
commit
9c029eb510
|
|
@ -62,18 +62,48 @@ export function createNocoDBEventsClient() {
|
||||||
if (filters?.limit) queryParams.set('limit', filters.limit.toString());
|
if (filters?.limit) queryParams.set('limit', filters.limit.toString());
|
||||||
if (filters?.offset) queryParams.set('offset', filters.offset.toString());
|
if (filters?.offset) queryParams.set('offset', filters.offset.toString());
|
||||||
|
|
||||||
// TEMPORARILY: Remove ALL filtering AND sorting to test basic functionality
|
|
||||||
// Just get all records to see if the table/API works at all
|
|
||||||
console.log('[nocodb-events] DEBUG: Testing with no filters or sorting at all');
|
|
||||||
|
|
||||||
const url = `${baseUrl}/api/v2/tables/${eventsTableId}/records?${queryParams.toString()}`;
|
const url = `${baseUrl}/api/v2/tables/${eventsTableId}/records?${queryParams.toString()}`;
|
||||||
|
|
||||||
const response = await $fetch(url, {
|
console.log('[nocodb-events] 🔍 DEBUG: Attempting to fetch events...');
|
||||||
method: 'GET',
|
console.log('[nocodb-events] 📋 Table ID:', eventsTableId);
|
||||||
headers
|
console.log('[nocodb-events] 🌐 Full URL:', url);
|
||||||
});
|
console.log('[nocodb-events] 🔑 Token (first 10 chars):', token?.substring(0, 10) + '...');
|
||||||
|
|
||||||
return response;
|
try {
|
||||||
|
const response = await $fetch(url, {
|
||||||
|
method: 'GET',
|
||||||
|
headers
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log('[nocodb-events] ✅ SUCCESS! Got response');
|
||||||
|
console.log('[nocodb-events] 📊 Response type:', typeof response);
|
||||||
|
console.log('[nocodb-events] 📝 Response keys:', Object.keys(response || {}));
|
||||||
|
|
||||||
|
if (response && typeof response === 'object') {
|
||||||
|
const responseObj = response as any;
|
||||||
|
if (responseObj.list && Array.isArray(responseObj.list)) {
|
||||||
|
console.log('[nocodb-events] 📈 Records found:', responseObj.list.length);
|
||||||
|
if (responseObj.list.length > 0) {
|
||||||
|
console.log('[nocodb-events] 🔍 First record keys (FIELD NAMES):', Object.keys(responseObj.list[0]));
|
||||||
|
console.log('[nocodb-events] 📄 Sample record:', JSON.stringify(responseObj.list[0], null, 2));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return response;
|
||||||
|
} catch (error: any) {
|
||||||
|
console.error('[nocodb-events] ❌ FAILED with error:', error);
|
||||||
|
console.error('[nocodb-events] 🔍 Error details:', {
|
||||||
|
message: error?.message,
|
||||||
|
status: error?.status,
|
||||||
|
statusCode: error?.statusCode,
|
||||||
|
statusMessage: error?.statusMessage,
|
||||||
|
data: error?.data
|
||||||
|
});
|
||||||
|
|
||||||
|
// Re-throw the error so the calling code can handle it
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue