complexqa_frontend_core 1.7.2 → 1.7.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "complexqa_frontend_core",
3
- "version": "1.7.2",
3
+ "version": "1.7.3",
4
4
  "description": "core of web ",
5
5
  "type": "module",
6
6
  "exports": {
@@ -169,6 +169,39 @@ export class ApiAbstractElementClass
169
169
  }
170
170
 
171
171
 
172
+ /**
173
+ *
174
+ * @version v.0.1 (08/03/2026)
175
+ * @param payload
176
+ */
177
+ async clone_element(payload)
178
+ {
179
+ if (!this.module_prefix)
180
+ {
181
+ throw new Error('Error #181-1152 in ApiAbstractClass');
182
+ }
183
+
184
+ if (this.stage === 'development')
185
+ {
186
+ return {
187
+ response: payload,
188
+ payload : payload
189
+ };
190
+ }
191
+
192
+ let url = `/${ this.api_prefix }/${ this.module_prefix }/clone_element`;
193
+
194
+ payload = this.handle_request_payload(payload);
195
+ let response = this.api_request(url, payload);
196
+ response = this.handle_response(response);
197
+
198
+ return {
199
+ response: response,
200
+ payload : payload
201
+ };
202
+ }
203
+
204
+
172
205
  /**
173
206
  *
174
207
  * @version v.0.1 (26/05/2024)
@@ -467,6 +467,35 @@ export class familyGeneralElement
467
467
  {
468
468
  element = this;
469
469
  }
470
+
471
+ let payload = {};
472
+
473
+ payload[this.get_primary_key()] = element[this.get_primary_key()];
474
+
475
+
476
+ /**
477
+ * {Api} ApiService
478
+ */
479
+ return ApiService[this.api_key].clone_element(payload).then((response) =>
480
+ {
481
+ if (typeof callback?.success === 'function')
482
+ {
483
+ callback?.success({ response, payload })
484
+ }
485
+ }).catch((error) =>
486
+ {
487
+ echo({ error });
488
+ if (typeof callback?.error === 'function')
489
+ {
490
+ callback?.error({ error, payload })
491
+ }
492
+ }).finally((response) =>
493
+ {
494
+ if (typeof callback?.final === 'function')
495
+ {
496
+ callback?.final({ response, payload })
497
+ }
498
+ });
470
499
  }
471
500
 
472
501
 
@@ -1,4 +1,3 @@
1
- import { familyGeneralElement } from "./0_familyGeneralElement";
2
1
  import { echo, is_object } from "../../utils/utils";
3
2
  import { familyTestDocumentation } from "./1_familyTestDocumentation.js";
4
3
 
@@ -1,4 +1,3 @@
1
- import { familyGeneralElement } from "./0_familyGeneralElement";
2
1
  import { is_object } from "../../utils/utils";
3
2
  import { familyTestDocumentation } from "./1_familyTestDocumentation.js";
4
3