@plyaz/core 1.7.1 → 1.7.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.
@@ -4844,7 +4844,34 @@ var BaseFrontendDomainService = class extends BaseDomainService {
4844
4844
  );
4845
4845
  }
4846
4846
  const rawData = this.unwrapResponseData(response.data);
4847
- const entities = (rawData ?? []).map((dto) => this.mapper.toDomain(dto));
4847
+ this.logDebug("fetchAll: checking config keys", {
4848
+ responseSuccessKey: this.config.responseSuccessKey,
4849
+ responseErrorKey: this.config.responseErrorKey,
4850
+ responseDataKey: this.config.responseDataKey,
4851
+ configKeys: Object.keys(this.config)
4852
+ });
4853
+ this.logDebug("fetchAll: response structure", {
4854
+ responseType: typeof response,
4855
+ responseKeys: response ? Object.keys(response) : [],
4856
+ responseDataType: typeof response.data,
4857
+ hasOk: "ok" in response,
4858
+ hasData: "data" in response
4859
+ });
4860
+ this.logDebug("fetchAll: after unwrap", {
4861
+ rawDataType: typeof rawData,
4862
+ isArray: Array.isArray(rawData),
4863
+ rawDataKeys: rawData && typeof rawData === "object" ? Object.keys(rawData) : []
4864
+ });
4865
+ if (!Array.isArray(rawData)) {
4866
+ this.logWarn("fetchAll: unwrapped data is not an array, check responseDataKey config", {
4867
+ responseDataKey: this.config.responseDataKey,
4868
+ actualType: typeof rawData,
4869
+ // Help debug by showing what we got
4870
+ receivedData: rawData
4871
+ });
4872
+ return [];
4873
+ }
4874
+ const entities = rawData.map((dto) => this.mapper.toDomain(dto));
4848
4875
  this.syncEntitiesToStore(entities);
4849
4876
  await this.afterFetchAll?.(entities, query);
4850
4877
  this.emitEvent("fetched", {