@sunggang/ui-lib 0.3.38 → 0.3.39

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.
Files changed (2) hide show
  1. package/index.esm2.js +7 -2
  2. package/package.json +1 -1
package/index.esm2.js CHANGED
@@ -78093,7 +78093,7 @@ function _ts_generator$1(thisArg, body) {
78093
78093
  }
78094
78094
  var fetchAPI = function() {
78095
78095
  var _ref = _async_to_generator$1(function(path) {
78096
- var _ref, _ref_method, method, body, token, queryParams, tmp, customHeaders, queryString, url, headers, response, _$error, error;
78096
+ var _ref, _ref_method, method, body, token, queryParams, tmp, customHeaders, queryString, url, headers, bodyData, response, _$error, error;
78097
78097
  var _arguments = arguments;
78098
78098
  return _ts_generator$1(this, function(_state) {
78099
78099
  switch(_state.label){
@@ -78107,6 +78107,11 @@ var fetchAPI = function() {
78107
78107
  if (token) {
78108
78108
  headers.Authorization = token;
78109
78109
  }
78110
+ if (headers["Content-Type"] === "application/x-www-form-urlencoded") {
78111
+ bodyData = new URLSearchParams(body).toString();
78112
+ } else if (body !== undefined) {
78113
+ bodyData = JSON.stringify(body);
78114
+ }
78110
78115
  _state.label = 1;
78111
78116
  case 1:
78112
78117
  _state.trys.push([
@@ -78120,7 +78125,7 @@ var fetchAPI = function() {
78120
78125
  fetch(url, {
78121
78126
  method: method,
78122
78127
  headers: headers,
78123
- body: body ? JSON.stringify(body) : undefined
78128
+ body: bodyData
78124
78129
  })
78125
78130
  ];
78126
78131
  case 2:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sunggang/ui-lib",
3
- "version": "0.3.38",
3
+ "version": "0.3.39",
4
4
  "dependencies": {
5
5
  "@emotion/react": "^11.14.0",
6
6
  "@emotion/styled": "^11.14.0",