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