@feardread/feature-factory 5.0.2 → 5.0.4

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.0.2",
3
+ "version": "5.0.4",
4
4
  "description": "Library to interact with redux toolkit and reduce boilerplate / repeated code",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -37,8 +37,7 @@ const CONFIG = {
37
37
  * @returns {string} Base URL
38
38
  */
39
39
  const getBaseUrl = () => {
40
- const env = process.env.NODE_ENV || 'development';
41
- //const uri = 'production';
40
+ const env = 'production'; //process.env.NODE_ENV || 'development';
42
41
  return CONFIG.baseUrls[env] || CONFIG.baseUrls.development;
43
42
  };
44
43
 
@@ -102,13 +102,13 @@ export function FeatureFactory(entity, reducers = {}, endpoints = null) {
102
102
  .addCase(action.fulfilled, (state, actionPayload) => {
103
103
  state.loading = false;
104
104
  state.success = true;
105
- state.data = actionPayload.payload.result;
105
+ state.data = actionPayload.payload;
106
106
 
107
107
  // Handle single item for fetchOne operation
108
108
  if (key === 'fetchOne' && Array.isArray(actionPayload.payload)) {
109
- state[sliceName] = actionPayload.payload[0].result;
109
+ state[sliceName] = actionPayload.payload[0];
110
110
  } else if (Array.isArray(actionPayload.payload) && actionPayload.payload.length > 0) {
111
- state[sliceName] = actionPayload.payload[0].result;
111
+ state[sliceName] = actionPayload.payload[0];
112
112
  }
113
113
  })
114
114
  .addCase(action.rejected, (state, actionPayload) => {