@cakemail-org/ui-components-v2 2.1.52 → 2.1.54

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/cjs/index.js CHANGED
@@ -10599,9 +10599,9 @@ function deletePopup(_a) {
10599
10599
  });
10600
10600
  }
10601
10601
  function updatePopup(_a) {
10602
- return __awaiter(this, void 0, void 0, function () {
10603
- var id = _a.id, popup = __rest(_a, ["id"]);
10604
- return __generator(this, function (_b) {
10602
+ return __awaiter(this, arguments, void 0, function (_b) {
10603
+ var id = _b.id, popup = _b.popup;
10604
+ return __generator(this, function (_c) {
10605
10605
  return [2 /*return*/, callApi({
10606
10606
  url: uiKitConfig.GATEWAY_PROXY + "/popups/".concat(id),
10607
10607
  fetchOptions: {
@@ -17800,12 +17800,11 @@ var ListPopupModel = /** @class */ (function () {
17800
17800
  });
17801
17801
  });
17802
17802
  };
17803
- ListPopupModel.prototype.save = function (_a) {
17803
+ ListPopupModel.prototype.save = function (popup) {
17804
17804
  return __awaiter(this, void 0, void 0, function () {
17805
17805
  var _this = this;
17806
- var popup = __rest(_a, []);
17807
- return __generator(this, function (_b) {
17808
- return [2 /*return*/, updatePopup({ id: this.id, popup: popup }).then(function (data) {
17806
+ return __generator(this, function (_a) {
17807
+ return [2 /*return*/, updatePopup({ id: this.id, popup: popup || this.toJson() }).then(function (data) {
17809
17808
  trackEvent(exports.EEvents.POPUP_UPDATED, { id: _this.id });
17810
17809
  return new PopupModel(data.data);
17811
17810
  })];
@@ -22,7 +22,7 @@ export declare class ListPopupModel {
22
22
  toJson(): any;
23
23
  set<T extends keyof this>(property: T, value: this[T]): void;
24
24
  delete(): Promise<TDeleteApiResource>;
25
- save({ ...popup }: Partial<TPopupModel>): Promise<PopupModel>;
25
+ save(popup?: Partial<TPopupModel>): Promise<PopupModel>;
26
26
  enable(): Promise<PopupModel>;
27
27
  disable(): Promise<PopupModel>;
28
28
  publish(): Promise<PopupModel>;
@@ -13,7 +13,7 @@ export declare function getPopup({ id }: {
13
13
  export declare function deletePopup({ id }: {
14
14
  id: string;
15
15
  }): Promise<TDeleteApiResource>;
16
- export declare function updatePopup({ id, ...popup }: {
16
+ export declare function updatePopup({ id, popup }: {
17
17
  id: string;
18
18
  popup: Partial<TPopupModel>;
19
19
  }): Promise<TUpdateApiResource<TPopupModel>>;
package/dist/esm/index.js CHANGED
@@ -10579,9 +10579,9 @@ function deletePopup(_a) {
10579
10579
  });
10580
10580
  }
10581
10581
  function updatePopup(_a) {
10582
- return __awaiter(this, void 0, void 0, function () {
10583
- var id = _a.id, popup = __rest(_a, ["id"]);
10584
- return __generator(this, function (_b) {
10582
+ return __awaiter(this, arguments, void 0, function (_b) {
10583
+ var id = _b.id, popup = _b.popup;
10584
+ return __generator(this, function (_c) {
10585
10585
  return [2 /*return*/, callApi({
10586
10586
  url: uiKitConfig.GATEWAY_PROXY + "/popups/".concat(id),
10587
10587
  fetchOptions: {
@@ -17780,12 +17780,11 @@ var ListPopupModel = /** @class */ (function () {
17780
17780
  });
17781
17781
  });
17782
17782
  };
17783
- ListPopupModel.prototype.save = function (_a) {
17783
+ ListPopupModel.prototype.save = function (popup) {
17784
17784
  return __awaiter(this, void 0, void 0, function () {
17785
17785
  var _this = this;
17786
- var popup = __rest(_a, []);
17787
- return __generator(this, function (_b) {
17788
- return [2 /*return*/, updatePopup({ id: this.id, popup: popup }).then(function (data) {
17786
+ return __generator(this, function (_a) {
17787
+ return [2 /*return*/, updatePopup({ id: this.id, popup: popup || this.toJson() }).then(function (data) {
17789
17788
  trackEvent(EEvents.POPUP_UPDATED, { id: _this.id });
17790
17789
  return new PopupModel(data.data);
17791
17790
  })];
@@ -22,7 +22,7 @@ export declare class ListPopupModel {
22
22
  toJson(): any;
23
23
  set<T extends keyof this>(property: T, value: this[T]): void;
24
24
  delete(): Promise<TDeleteApiResource>;
25
- save({ ...popup }: Partial<TPopupModel>): Promise<PopupModel>;
25
+ save(popup?: Partial<TPopupModel>): Promise<PopupModel>;
26
26
  enable(): Promise<PopupModel>;
27
27
  disable(): Promise<PopupModel>;
28
28
  publish(): Promise<PopupModel>;
@@ -13,7 +13,7 @@ export declare function getPopup({ id }: {
13
13
  export declare function deletePopup({ id }: {
14
14
  id: string;
15
15
  }): Promise<TDeleteApiResource>;
16
- export declare function updatePopup({ id, ...popup }: {
16
+ export declare function updatePopup({ id, popup }: {
17
17
  id: string;
18
18
  popup: Partial<TPopupModel>;
19
19
  }): Promise<TUpdateApiResource<TPopupModel>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cakemail-org/ui-components-v2",
3
- "version": "2.1.52",
3
+ "version": "2.1.54",
4
4
  "description": "ui library kit made with material UI",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",