nextemos 5.1.12 → 5.1.14

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.
@@ -72,6 +72,13 @@ const fetchRequest = () => {
72
72
  console.log(`Fetch Request: ${method}`, apiURL.toString(), FETCH_OPTIONS.LOG_LEVEL === "debug" ? requestOptions : "");
73
73
  try {
74
74
  const response = yield fetch(apiURL.toString(), requestOptions);
75
+ // Headers nesnesini Object'e dönüştürme
76
+ const headers = {};
77
+ if (response === null || response === void 0 ? void 0 : response.headers) {
78
+ response.headers.forEach((value, name) => {
79
+ headers[name] = value;
80
+ });
81
+ }
75
82
  if (!response.ok) {
76
83
  const errorDetail = yield response.text();
77
84
  if (["debug", "info", "trace"].includes(FETCH_OPTIONS.LOG_LEVEL))
@@ -84,15 +91,9 @@ const fetchRequest = () => {
84
91
  return {
85
92
  status: response.status,
86
93
  errorMessage: errorDetail,
94
+ headers,
87
95
  };
88
96
  }
89
- // Headers nesnesini Object'e dönüştürme
90
- const headers = {};
91
- if (response === null || response === void 0 ? void 0 : response.headers) {
92
- response.headers.forEach((value, name) => {
93
- headers[name] = value;
94
- });
95
- }
96
97
  let responseModel;
97
98
  if (Object.keys(headers).length > 0 &&
98
99
  headers.hasOwnProperty("content-type") &&
@@ -64,7 +64,7 @@ exports.ProductService = {
64
64
  return (0, __1.fetchRequest)().get(exports.ProductService.Url(urls_1.default.ProductCategory.CategoryTree, options, data === null || data === void 0 ? void 0 : data.language), Object.assign(Object.assign({}, options), { params: data }));
65
65
  }),
66
66
  AllCategories: (data, options) => __awaiter(void 0, void 0, void 0, function* () {
67
- return (0, __1.fetchRequest)().post(exports.ProductService.Url(urls_1.default.ProductCategory.All, options, data === null || data === void 0 ? void 0 : data.language), Object.assign(Object.assign({}, options), { body: JSON.stringify(data) }));
67
+ return (0, __1.fetchRequest)().get(exports.ProductService.Url(urls_1.default.ProductCategory.All, options, data === null || data === void 0 ? void 0 : data.language), Object.assign(Object.assign({}, options), { params: data }));
68
68
  }),
69
69
  Hierarchy: (data, options) => __awaiter(void 0, void 0, void 0, function* () {
70
70
  return (0, __1.fetchRequest)().get(exports.ProductService.Url(urls_1.default.ProductCategory.Hierarchy, options, data === null || data === void 0 ? void 0 : data.language), Object.assign(Object.assign({}, options), { params: data }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nextemos",
3
- "version": "5.1.12",
3
+ "version": "5.1.14",
4
4
  "description": "For helpers and hooks used in NextJS projects",
5
5
  "main": "dist/index.js",
6
6
  "types": "./dist/index.d.ts",