@feardread/feature-factory 5.0.0 → 5.0.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.0.0",
3
+ "version": "5.0.1",
4
4
  "description": "Library to interact with redux toolkit and reduce boilerplate / repeated code",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -51,6 +51,10 @@ const validateThunkParams = (entity, prefix) => {
51
51
  */
52
52
  const buildUrl = (entity, prefix, params = {}, useIdInUrl = false) => {
53
53
  let url = `${entity}`;
54
+
55
+ if( prefix === 'one') {
56
+ url += `/${params.id}`;
57
+ }
54
58
 
55
59
  if (useIdInUrl && params?.id) {
56
60
  url += `/${params.id}`;
@@ -68,8 +72,6 @@ const buildUrl = (entity, prefix, params = {}, useIdInUrl = false) => {
68
72
  */
69
73
  const handleResponse = (response) => {
70
74
  // Handle different response structures
71
- console.log('resp = ', response)
72
- return response.data;
73
75
  if (response?.data?.result !== undefined) {
74
76
  return response.data.result;
75
77
  }
@@ -176,7 +178,7 @@ export const ThunkFactory = {
176
178
 
177
179
  // Fallback to original behavior for custom prefixes
178
180
  const useParams = prefix === 'search';
179
- const useIdInUrl = prefix === 'one';
181
+ //const useIdInUrl = prefix === 'one';
180
182
 
181
183
  return createGenericThunk(entity, prefix, {
182
184
  method: HTTP_METHODS.GET,