@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.
@@ -5016,7 +5016,34 @@ var init_BaseFrontendDomainService = __esm({
5016
5016
  );
5017
5017
  }
5018
5018
  const rawData = this.unwrapResponseData(response.data);
5019
- const entities = (rawData ?? []).map((dto) => this.mapper.toDomain(dto));
5019
+ this.logDebug("fetchAll: checking config keys", {
5020
+ responseSuccessKey: this.config.responseSuccessKey,
5021
+ responseErrorKey: this.config.responseErrorKey,
5022
+ responseDataKey: this.config.responseDataKey,
5023
+ configKeys: Object.keys(this.config)
5024
+ });
5025
+ this.logDebug("fetchAll: response structure", {
5026
+ responseType: typeof response,
5027
+ responseKeys: response ? Object.keys(response) : [],
5028
+ responseDataType: typeof response.data,
5029
+ hasOk: "ok" in response,
5030
+ hasData: "data" in response
5031
+ });
5032
+ this.logDebug("fetchAll: after unwrap", {
5033
+ rawDataType: typeof rawData,
5034
+ isArray: Array.isArray(rawData),
5035
+ rawDataKeys: rawData && typeof rawData === "object" ? Object.keys(rawData) : []
5036
+ });
5037
+ if (!Array.isArray(rawData)) {
5038
+ this.logWarn("fetchAll: unwrapped data is not an array, check responseDataKey config", {
5039
+ responseDataKey: this.config.responseDataKey,
5040
+ actualType: typeof rawData,
5041
+ // Help debug by showing what we got
5042
+ receivedData: rawData
5043
+ });
5044
+ return [];
5045
+ }
5046
+ const entities = rawData.map((dto) => this.mapper.toDomain(dto));
5020
5047
  this.syncEntitiesToStore(entities);
5021
5048
  await this.afterFetchAll?.(entities, query);
5022
5049
  this.emitEvent("fetched", {