@amirjalili1374/ui-kit 1.4.10 → 1.4.11

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/ui-kit.es.js CHANGED
@@ -13181,11 +13181,8 @@ function apiService(axiosInst, resource) {
13181
13181
  const response = await axiosInst.post(baseUrl, data2);
13182
13182
  return response;
13183
13183
  },
13184
- async update(data2) {
13185
- if (!data2.id) {
13186
- throw new Error("Update requires an id field");
13187
- }
13188
- const response = await axiosInst.put(`${baseUrl}/${data2.id}`, data2);
13184
+ async update(id, data2) {
13185
+ const response = await axiosInst.put(`${baseUrl}/${id}`, data2);
13189
13186
  return response;
13190
13187
  },
13191
13188
  async delete(id) {
@@ -17594,7 +17591,9 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent$1({
17594
17591
  }
17595
17592
  });
17596
17593
  if (isEditing.value && dataToSave.id) {
17597
- await api.update(dataToSave);
17594
+ const recordId = dataToSave.id;
17595
+ const { id, ...dataWithoutId } = dataToSave;
17596
+ await api.update(recordId, dataWithoutId);
17598
17597
  snackbarMessage.value = "✅ آیتم با موفقیت بروزرسانی شد!";
17599
17598
  } else {
17600
17599
  const response = await api.create(dataToSave);