@lobb-js/studio 0.24.0 → 0.24.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -129,23 +129,22 @@
|
|
|
129
129
|
});
|
|
130
130
|
const finalRows = eventResult.rows ?? transformedRows;
|
|
131
131
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
: (body?.message ?? `HTTP ${response.status}`);
|
|
147
|
-
importResults = finalRows.map((row: any) => ({ row, error: message }));
|
|
132
|
+
importResults = [];
|
|
133
|
+
let hasSuccess = false;
|
|
134
|
+
for (const row of finalRows) {
|
|
135
|
+
const response = await lobb.createOne(collectionName, row);
|
|
136
|
+
if (response.ok) {
|
|
137
|
+
importResults.push({ row, error: null });
|
|
138
|
+
hasSuccess = true;
|
|
139
|
+
} else {
|
|
140
|
+
const body = await response.json().catch(() => null);
|
|
141
|
+
const message = body?.details
|
|
142
|
+
? Object.entries(body.details).map(([f, msgs]) => `${f}: ${(msgs as string[]).join(", ")}`).join(" | ")
|
|
143
|
+
: (body?.message ?? `HTTP ${response.status}`);
|
|
144
|
+
importResults.push({ row, error: message });
|
|
145
|
+
}
|
|
148
146
|
}
|
|
147
|
+
if (hasSuccess && onSuccessfullSave) await onSuccessfullSave();
|
|
149
148
|
|
|
150
149
|
step = "results";
|
|
151
150
|
} catch (e: any) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobb-js/studio",
|
|
3
3
|
"license": "UNLICENSED",
|
|
4
|
-
"version": "0.24.
|
|
4
|
+
"version": "0.24.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"postpublish": "./scripts/postpublish.sh"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@lobb-js/core": "^0.26.
|
|
45
|
+
"@lobb-js/core": "^0.26.2",
|
|
46
46
|
"@chromatic-com/storybook": "^4.1.2",
|
|
47
47
|
"@storybook/addon-a11y": "^10.0.1",
|
|
48
48
|
"@storybook/addon-docs": "^10.0.1",
|
package/src/app.css
CHANGED
|
@@ -129,23 +129,22 @@
|
|
|
129
129
|
});
|
|
130
130
|
const finalRows = eventResult.rows ?? transformedRows;
|
|
131
131
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
: (body?.message ?? `HTTP ${response.status}`);
|
|
147
|
-
importResults = finalRows.map((row: any) => ({ row, error: message }));
|
|
132
|
+
importResults = [];
|
|
133
|
+
let hasSuccess = false;
|
|
134
|
+
for (const row of finalRows) {
|
|
135
|
+
const response = await lobb.createOne(collectionName, row);
|
|
136
|
+
if (response.ok) {
|
|
137
|
+
importResults.push({ row, error: null });
|
|
138
|
+
hasSuccess = true;
|
|
139
|
+
} else {
|
|
140
|
+
const body = await response.json().catch(() => null);
|
|
141
|
+
const message = body?.details
|
|
142
|
+
? Object.entries(body.details).map(([f, msgs]) => `${f}: ${(msgs as string[]).join(", ")}`).join(" | ")
|
|
143
|
+
: (body?.message ?? `HTTP ${response.status}`);
|
|
144
|
+
importResults.push({ row, error: message });
|
|
145
|
+
}
|
|
148
146
|
}
|
|
147
|
+
if (hasSuccess && onSuccessfullSave) await onSuccessfullSave();
|
|
149
148
|
|
|
150
149
|
step = "results";
|
|
151
150
|
} catch (e: any) {
|