Ver código fonte

Added ability to match column names with numbers in them.

vtugulan 3 dias atrás
pai
commit
776d866a0e
1 arquivos alterados com 1 adições e 3 exclusões
  1. 1 3
      app/lib/excel-import/bulk-inserter.ts

+ 1 - 3
app/lib/excel-import/bulk-inserter.ts

@@ -35,15 +35,13 @@ export class BulkInserter {
           // Map the row data to match Prisma model field names
           Object.keys(row).forEach(key => {
             // Convert snake_case to camelCase for Prisma model compatibility
-            const camelKey = key.replace(/_([a-z])/g, (g) => g[1].toUpperCase());
+            const camelKey = key.replace(/_([a-z0-9])/g, (g) => g[1].toUpperCase());
             mappedRow[camelKey] = row[key];
           });
 
           return mappedRow;
         });
 
-        console.log(batch)
-        console.log(values);
         // Use appropriate Prisma model based on table name
         if (tableName === 'cintas_install_calendar') {
           await this.prisma.cintasInstallCalendar.createMany({