@elite.framework/ng.core 1.0.16 → 1.0.17

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.
@@ -3805,18 +3805,22 @@ class GenericSelectorTypeComponent extends FieldType {
3805
3805
  }
3806
3806
  loadDefaultValue() {
3807
3807
  this.loading = true;
3808
- const defaultFilter = { isDefault: true };
3809
3808
  const vf = this.to['valueField'] || 'id';
3810
- this.api.getList(defaultFilter)
3809
+ const fixedFilters = this.to['fixedFilters'] || {};
3810
+ const searchParams = {
3811
+ isDefault: true,
3812
+ ...fixedFilters,
3813
+ };
3814
+ this.api.getList(searchParams)
3811
3815
  .subscribe({
3812
3816
  next: (res) => {
3813
3817
  // Assuming the API returns a list and you want to select the first one
3814
- if (res && res.data && res.data.length > 0) {
3818
+ if (res && res.items && res.items.length > 0) {
3815
3819
  if (this.to['multiple']) {
3816
- this.formControl.setValue(res.data.map((c) => c[vf]));
3820
+ this.formControl.setValue(res.items.map((c) => c[vf]));
3817
3821
  }
3818
3822
  else {
3819
- const defaultValue = res.data[0];
3823
+ const defaultValue = res.items[0];
3820
3824
  this.formControl.setValue(defaultValue?.[vf]);
3821
3825
  }
3822
3826
  }