next-recomponents 1.6.7 → 1.6.8

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.
package/dist/index.js CHANGED
@@ -43681,12 +43681,12 @@ function useResources({
43681
43681
  const d = consulta.data;
43682
43682
  newInfo[key].state = "success";
43683
43683
  newInfo[key].errorMessage = "";
43684
- newInfo[key].selectedItem = d;
43684
+ newInfo[key].selectedItem = __spreadValues(__spreadValues({}, newInfo[key].selectedItem), d);
43685
43685
  const index = (_b = (_a = newInfo[key]) == null ? void 0 : _a.data) == null ? void 0 : _b.findIndex(
43686
43686
  (d2) => (d2 == null ? void 0 : d2.id) == id3
43687
43687
  );
43688
43688
  if (index >= 0) {
43689
- newInfo[key].data[index] = d;
43689
+ newInfo[key].data[index] = __spreadValues(__spreadValues({}, newInfo[key].data[index]), d);
43690
43690
  } else {
43691
43691
  if ((_c2 = newInfo[key]) == null ? void 0 : _c2.data) {
43692
43692
  newInfo[key].data.unshift(d);
package/dist/index.mjs CHANGED
@@ -43668,12 +43668,12 @@ function useResources({
43668
43668
  const d = consulta.data;
43669
43669
  newInfo[key].state = "success";
43670
43670
  newInfo[key].errorMessage = "";
43671
- newInfo[key].selectedItem = d;
43671
+ newInfo[key].selectedItem = __spreadValues(__spreadValues({}, newInfo[key].selectedItem), d);
43672
43672
  const index = (_b = (_a = newInfo[key]) == null ? void 0 : _a.data) == null ? void 0 : _b.findIndex(
43673
43673
  (d2) => (d2 == null ? void 0 : d2.id) == id3
43674
43674
  );
43675
43675
  if (index >= 0) {
43676
- newInfo[key].data[index] = d;
43676
+ newInfo[key].data[index] = __spreadValues(__spreadValues({}, newInfo[key].data[index]), d);
43677
43677
  } else {
43678
43678
  if ((_c2 = newInfo[key]) == null ? void 0 : _c2.data) {
43679
43679
  newInfo[key].data.unshift(d);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-recomponents",
3
- "version": "1.6.7",
3
+ "version": "1.6.8",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -217,12 +217,13 @@ export default function useResources<T extends Record<string, ItemsRecord>>({
217
217
  const d = consulta.data;
218
218
  newInfo[key].state = "success";
219
219
  newInfo[key].errorMessage = "";
220
- newInfo[key].selectedItem = d;
220
+ newInfo[key].selectedItem = { ...newInfo[key].selectedItem, ...d };
221
221
  const index = newInfo[key]?.data?.findIndex(
222
222
  (d: any) => d?.id == id
223
223
  );
224
+
224
225
  if (index >= 0) {
225
- newInfo[key].data[index] = d;
226
+ newInfo[key].data[index] = { ...newInfo[key].data[index], ...d };
226
227
  } else {
227
228
  if (newInfo[key]?.data) {
228
229
  newInfo[key].data.unshift(d);