File tree Expand file tree Collapse file tree 2 files changed +24
-3
lines changed
app/evaluacion-previsional/resultados Expand file tree Collapse file tree 2 files changed +24
-3
lines changed Original file line number Diff line number Diff line change @@ -160,9 +160,23 @@ function ResultadosContent() {
160160
161161 setShowSuccessMessage ( true ) ;
162162 setSubscriptionData ( { nombre : '' , email : '' } ) ;
163- } catch ( error ) {
163+ } catch ( error : any ) {
164164 console . error ( 'Error al guardar suscripción:' , error ) ;
165- setError ( 'Hubo un error al procesar tu suscripción. Por favor, intenta nuevamente.' ) ;
165+ let errorMsg = 'Hubo un error al procesar tu suscripción. Por favor, intenta nuevamente.' ;
166+ if ( error && error . message ) {
167+ errorMsg += `\nDetalles: ${ error . message } ` ;
168+ }
169+ if ( error && error . statusCode ) {
170+ errorMsg += `\nStatusCode: ${ error . statusCode } ` ;
171+ }
172+ if ( error && error . response ) {
173+ errorMsg += `\nResponse: ${ JSON . stringify ( error . response ) } ` ;
174+ }
175+ if ( error && error . data ) {
176+ errorMsg += `\nData: ${ JSON . stringify ( error . data ) } ` ;
177+ }
178+ errorMsg += `\nError completo: ${ JSON . stringify ( error ) } ` ;
179+ setError ( errorMsg ) ;
166180 }
167181 } ;
168182
Original file line number Diff line number Diff line change 11import Airtable from 'airtable' ;
22
3+ // Log para verificar la API key (sin mostrar la key completa por seguridad)
4+ const apiKey = process . env . NEXT_PUBLIC_AIRTABLE_API_KEY ;
5+ console . log ( 'API Key presente:' , ! ! apiKey ) ;
6+ console . log ( 'API Key longitud:' , apiKey ?. length ) ;
7+ console . log ( 'Base ID:' , process . env . NEXT_PUBLIC_AIRTABLE_BASE_ID ) ;
8+
39if ( ! process . env . NEXT_PUBLIC_AIRTABLE_API_KEY ) {
410 throw new Error ( 'NEXT_PUBLIC_AIRTABLE_API_KEY is not defined in environment variables' ) ;
511}
@@ -25,7 +31,8 @@ export async function createEvaluation(data: EvaluationData) {
2531 try {
2632 console . log ( 'Intentando guardar en Airtable:' , {
2733 table : TABLE_NAME ,
28- data : data
34+ data : data ,
35+ apiKeyPresent : ! ! process . env . NEXT_PUBLIC_AIRTABLE_API_KEY
2936 } ) ;
3037
3138 const fields : Record < string , any > = {
You can’t perform that action at this time.
0 commit comments