@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
- const txBody = finalRows.map((row: any) => ({
133
- method: "createOne",
134
- props: { collectionName, data: row },
135
- }));
136
-
137
- const response = await lobb.transactions(txBody);
138
-
139
- if (response.ok) {
140
- importResults = finalRows.map((row: any) => ({ row, error: null }));
141
- if (onSuccessfullSave) await onSuccessfullSave();
142
- } else {
143
- const body = await response.json().catch(() => null);
144
- const message = body?.details
145
- ? Object.entries(body.details).map(([f, msgs]) => `${f}: ${(msgs as string[]).join(", ")}`).join(" | ")
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.0",
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.0",
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
@@ -3,7 +3,6 @@
3
3
  @import "tw-animate-css";
4
4
 
5
5
  @source "../../../packages";
6
- @source "../node_modules/@lobb-js";
7
6
 
8
7
  @custom-variant dark (&:is(.dark *));
9
8
 
@@ -129,23 +129,22 @@
129
129
  });
130
130
  const finalRows = eventResult.rows ?? transformedRows;
131
131
 
132
- const txBody = finalRows.map((row: any) => ({
133
- method: "createOne",
134
- props: { collectionName, data: row },
135
- }));
136
-
137
- const response = await lobb.transactions(txBody);
138
-
139
- if (response.ok) {
140
- importResults = finalRows.map((row: any) => ({ row, error: null }));
141
- if (onSuccessfullSave) await onSuccessfullSave();
142
- } else {
143
- const body = await response.json().catch(() => null);
144
- const message = body?.details
145
- ? Object.entries(body.details).map(([f, msgs]) => `${f}: ${(msgs as string[]).join(", ")}`).join(" | ")
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) {