@feardread/feature-factory 4.0.5 → 4.0.6
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/api.js +4 -2
- package/src/factory/thunk.js +1 -0
package/package.json
CHANGED
package/src/factory/api.js
CHANGED
|
@@ -38,8 +38,8 @@ const CONFIG = {
|
|
|
38
38
|
*/
|
|
39
39
|
const getBaseUrl = () => {
|
|
40
40
|
const env = process.env.NODE_ENV || 'development';
|
|
41
|
-
const uri = 'production';
|
|
42
|
-
return CONFIG.baseUrls[
|
|
41
|
+
//const uri = 'production';
|
|
42
|
+
return CONFIG.baseUrls[env] || CONFIG.baseUrls.development;
|
|
43
43
|
};
|
|
44
44
|
|
|
45
45
|
/**
|
|
@@ -237,6 +237,7 @@ const responseInterceptor = (response) => {
|
|
|
237
237
|
if (process.env.NODE_ENV === 'development') {
|
|
238
238
|
console.log(`✅ API Success [${response.status}]:`, {
|
|
239
239
|
url: response.config.url,
|
|
240
|
+
data: response.data,
|
|
240
241
|
method: response.config.method?.toUpperCase(),
|
|
241
242
|
responseTime: response.metadata.responseTime,
|
|
242
243
|
requestId: response.metadata.requestId,
|
|
@@ -278,6 +279,7 @@ const responseErrorInterceptor = async (error) => {
|
|
|
278
279
|
if (process.env.NODE_ENV === 'development') {
|
|
279
280
|
console.error(`❌ API Error [${formattedError.status}]:`, {
|
|
280
281
|
url: originalRequest?.url,
|
|
282
|
+
error: formattedError,
|
|
281
283
|
method: originalRequest?.method?.toUpperCase(),
|
|
282
284
|
message: formattedError.message,
|
|
283
285
|
requestId: originalRequest?.headers['X-Request-ID'],
|
package/src/factory/thunk.js
CHANGED
|
@@ -19,6 +19,7 @@ const STANDARD_OPERATIONS = {
|
|
|
19
19
|
all: { method: HTTP_METHODS.GET, useParams: false },
|
|
20
20
|
one: { method: HTTP_METHODS.GET, useParams: false, useIdInUrl: true },
|
|
21
21
|
search: { method: HTTP_METHODS.GET, useParams: true },
|
|
22
|
+
new: { method: HTTP_METHODS.POST, useParams: false },
|
|
22
23
|
create: { method: HTTP_METHODS.POST, useParams: false },
|
|
23
24
|
update: { method: HTTP_METHODS.PUT, useParams: false, useIdInUrl: true },
|
|
24
25
|
patch: { method: HTTP_METHODS.PATCH, useParams: false, useIdInUrl: true },
|