@feardread/feature-factory 5.1.0 → 5.1.1

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feardread/feature-factory",
3
- "version": "5.1.0",
3
+ "version": "5.1.1",
4
4
  "description": "Library to interact with redux toolkit and reduce boilerplate / repeated code",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -282,10 +282,10 @@ export const addHandlers = (builder, asyncActions, entity) => {
282
282
 
283
283
  // Handle different response structures
284
284
  const payload = actionPayload.payload;
285
-
285
+ console.log('payload = ', payload);
286
286
  // Update data based on operation type
287
287
  if (key === 'fetch' || key === 'search') {
288
- state.data = Array.isArray(payload) ? payload : (payload?.data || []);
288
+ state.data = Array.isArray(payload) ? payload : (payload?.data.result || []);
289
289
  } else if (key === 'fetchOne') {
290
290
  state[entity] = Array.isArray(payload) ? payload[0] : payload;
291
291
  } else if (key === 'create') {