@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/dist/bundle.min.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/factory/thunk.js +5 -3
package/package.json
CHANGED
package/src/factory/thunk.js
CHANGED
|
@@ -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,
|