modified: docker-compose.yml

modified:   package-lock.json
	modified:   package.json
	modified:   src/screens/ImportExportScreen.tsx
	modified:   src/screens/ManageProductsScreen.tsx
	modified:   src/services/importExportService.test.ts
	modified:   src/services/importExportService.ts
This commit is contained in:
2025-11-25 09:15:30 +10:00
parent 2ec46c733b
commit fc55073ca6
7 changed files with 45 additions and 29 deletions
+8 -11
View File
@@ -50,10 +50,11 @@ const inferTypeFromName = (name: string): DataType | undefined => {
const parseCsv = async (content: string) => {
const result = Papa.parse<Record<string, string>>(content, {
header: true,
skipEmptyLines: true,
transformHeader: (header) => header.trim().toLowerCase(),
});
header: true,
skipEmptyLines: true,
transformHeader: (header: string) => header.trim().toLowerCase(),
});
if (result.errors.length > 0) {
throw new Error(result.errors[0].message);
@@ -329,13 +330,9 @@ export const importFiles = async (
try {
await db.transaction(
'rw',
db.areas,
db.categories,
db.products,
db.pickLists,
db.pickItems,
async () => {
'rw',
[db.areas, db.categories, db.products, db.pickLists, db.pickItems],
async () => {
const parseTimestamp = (value?: string) =>
value && value.trim() !== '' ? Number(value) || now : now;