@@ -31,16 +31,15 @@ export default {
3131 } ) ;
3232
3333 const { webhookId, sample_response } = data ;
34- const hookId = webhookId ;
35- this . _setHookID ( hookId ) ;
34+ this . _setHookID ( webhookId ) ;
3635
3736 if ( ! Array . isArray ( sample_response ) || sample_response . length === 0 ) {
3837 throw new Error ( "Unable to fetch sample data from selected sheet." ) ;
3938 }
4039
4140 const first = sample_response [ 0 ] ;
4241 this . $emit ( {
43- import_id : `sample_${ Date . now ( ) } ` ,
42+ import_id : `sample_${ Date . now ( ) } _ ${ Math . random ( ) . toString ( 36 ) . slice ( 2 , 9 ) } ` ,
4443 sheet_id : this . sheetId ,
4544 sheet_name : first . sheet_name || "Sample Data" ,
4645 row_number : first . row_number || 1 ,
@@ -51,7 +50,7 @@ export default {
5150 import_description : first . import_description || "This is a sample test import" ,
5251 original_filename : first . original_filename || "product_details.csv" ,
5352 } , {
54- id : `sample_${ Date . now ( ) } ` ,
53+ id : `sample_${ Date . now ( ) } _ ${ Math . random ( ) . toString ( 36 ) . slice ( 2 , 9 ) } ` ,
5554 summary : `Sample data loaded from sheet - ${ first . sheet_name } ` ,
5655 ts : Date . now ( ) ,
5756 } ) ;
@@ -73,8 +72,8 @@ export default {
7372 sheet_slug : this . sheetId ,
7473 } ,
7574 } ) ;
76- this . db . set ( "hookId" , null ) ;
77- this . db . set ( "sampleRow" , null ) ;
75+ this . _setHookID ( null ) ;
76+ this . _setSampleRow ( null ) ;
7877 }
7978 } catch ( err ) {
8079 console . error ( "Deactivation Error:" , err ) ;
@@ -119,7 +118,7 @@ export default {
119118
120119 for ( const row of body ) {
121120 this . $emit ( row , {
122- id : row . import_id || `${ row . sheet_id } _${ Date . now ( ) } ` ,
121+ id : row . import_id || `${ row . sheet_id } _${ row . row_number } _ ${ Date . now ( ) } ` ,
123122 summary : `New data imported to sheet ${ row . sheet_name } ` ,
124123 ts : Date . now ( ) ,
125124 } ) ;
0 commit comments