@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feardread/feature-factory",
3
- "version": "4.0.5",
3
+ "version": "4.0.6",
4
4
  "description": "Library to interact with redux toolkit and reduce boilerplate / repeated code",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -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[uri] || CONFIG.baseUrls.development;
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'],
@@ -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 },