primary_care_admin_binder 0.1.198 → 0.1.199
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/index.cjs.js +14 -13
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -8270,7 +8270,8 @@ var moment = createCommonjsModule(function (module, exports) {
|
|
|
8270
8270
|
var fetchData = /*#__PURE__*/function () {
|
|
8271
8271
|
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(input) {
|
|
8272
8272
|
var url,
|
|
8273
|
-
|
|
8273
|
+
jwtToken,
|
|
8274
|
+
token,
|
|
8274
8275
|
__options,
|
|
8275
8276
|
res,
|
|
8276
8277
|
data,
|
|
@@ -8279,13 +8280,18 @@ var fetchData = /*#__PURE__*/function () {
|
|
|
8279
8280
|
while (1) switch (_context.n) {
|
|
8280
8281
|
case 0:
|
|
8281
8282
|
url = _args.length > 1 && _args[1] !== undefined ? _args[1] : __baseUrl__;
|
|
8282
|
-
|
|
8283
|
+
jwtToken = _args.length > 2 ? _args[2] : undefined;
|
|
8284
|
+
// Host app (primarycarebackoffice) sets window.binderAuthToken from its
|
|
8285
|
+
// in-memory AuthContext on login/refresh - this package can't import that
|
|
8286
|
+
// module directly, and the token is intentionally never persisted to
|
|
8287
|
+
// localStorage, so a plain window global is the bridge.
|
|
8288
|
+
token = jwtToken || (typeof window !== "undefined" ? window.binderAuthToken : undefined);
|
|
8283
8289
|
__options = {
|
|
8284
8290
|
method: "POST",
|
|
8285
8291
|
credentials: "include",
|
|
8286
|
-
headers:
|
|
8287
|
-
"Content-Type": "application/json"
|
|
8288
|
-
"jwtToken":
|
|
8292
|
+
headers: token ? {
|
|
8293
|
+
"Content-Type": "application/json"
|
|
8294
|
+
// "jwtToken": token
|
|
8289
8295
|
} : {
|
|
8290
8296
|
"Content-Type": "application/json"
|
|
8291
8297
|
},
|
|
@@ -8380,7 +8386,6 @@ var fetchDataApi = /*#__PURE__*/function () {
|
|
|
8380
8386
|
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
|
|
8381
8387
|
var url,
|
|
8382
8388
|
input,
|
|
8383
|
-
jwtToken,
|
|
8384
8389
|
__options,
|
|
8385
8390
|
res,
|
|
8386
8391
|
_args2 = arguments;
|
|
@@ -8389,16 +8394,13 @@ var fetchDataApi = /*#__PURE__*/function () {
|
|
|
8389
8394
|
case 0:
|
|
8390
8395
|
url = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : __baseUrl__;
|
|
8391
8396
|
input = _args2.length > 1 ? _args2[1] : undefined;
|
|
8392
|
-
jwtToken = localStorage.getItem("jwttoken"); // get jwt token from local storage
|
|
8393
8397
|
__options = input || {};
|
|
8394
8398
|
__options.credentials = "include";
|
|
8395
|
-
if (__options.headers) {
|
|
8396
|
-
__options.headers.jwttoken = jwtToken;
|
|
8397
|
-
} else {
|
|
8399
|
+
if (__options.headers) ; else {
|
|
8398
8400
|
__options.headers = {
|
|
8399
8401
|
"Content-Type": "application/json",
|
|
8400
|
-
Accept: "application/json"
|
|
8401
|
-
jwttoken: jwtToken
|
|
8402
|
+
Accept: "application/json"
|
|
8403
|
+
// jwttoken: jwtToken,
|
|
8402
8404
|
};
|
|
8403
8405
|
}
|
|
8404
8406
|
_context2.n = 1;
|
|
@@ -8796,7 +8798,6 @@ var GET_MOH_USER_DETAIL = createAsyncThunk("practitionerSlice/get_moh_user_detai
|
|
|
8796
8798
|
payload = _ref11.payload, jwtToken = _ref11.jwtToken;
|
|
8797
8799
|
rejectWithValue = _ref12.rejectWithValue;
|
|
8798
8800
|
_context7.p = 1;
|
|
8799
|
-
console.log(jwtToken, "jwtT");
|
|
8800
8801
|
_context7.n = 2;
|
|
8801
8802
|
return fetchData({
|
|
8802
8803
|
body: JSON.stringify(payload)
|