@lenne.tech/ng-base 14.2.1 → 14.2.2

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.
@@ -1032,10 +1032,13 @@ class ModelFormComponent {
1032
1032
  }
1033
1033
  }
1034
1034
  /**
1035
- * > If the model name and meta data are present, set the operation to update or create, get the fields from the meta
1036
- * data, create the form, and if the value is present, patch the form with the value
1035
+ * > If the model name and metadata are present, set the operation to update or create, get the fields from the
1036
+ * metadata, create the form, and if the value is present, patch the form with the value
1037
1037
  */
1038
- init() {
1038
+ init(id) {
1039
+ if (id) {
1040
+ this.id = id;
1041
+ }
1039
1042
  if (this.modelName && this.meta) {
1040
1043
  this.operation = this.id ? 'update' : 'create';
1041
1044
  this.fields = this.meta.getArgs(this.operation + this.capitalizeFirstLetter(this.modelName), {
@@ -1180,7 +1183,7 @@ class ModelFormComponent {
1180
1183
  this.cmsService.duplicateObject(this.id, this.modelName).then(async (value) => {
1181
1184
  if (value?.id) {
1182
1185
  await this.router.navigate(['../' + value.id], { relativeTo: this.route });
1183
- this.init();
1186
+ this.init(value.id);
1184
1187
  }
1185
1188
  else {
1186
1189
  this.finished.emit(null);