primary_care_admin_binder 0.1.182 → 0.1.184
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 +41 -6
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -12691,11 +12691,15 @@ var queries$n = {
|
|
|
12691
12691
|
metadata_dbname: metaDatadbName$1
|
|
12692
12692
|
}, doc)];
|
|
12693
12693
|
},
|
|
12694
|
-
locationtree: function locationtree() {
|
|
12694
|
+
locationtree: function locationtree(search, offset, limit) {
|
|
12695
12695
|
return {
|
|
12696
12696
|
appcode: dbName,
|
|
12697
12697
|
requestid: "24f4da82-c4ae-40a4-b894-f7cf9dd398d1",
|
|
12698
|
-
filter: {
|
|
12698
|
+
filter: {
|
|
12699
|
+
search: search ? "%".concat(search, "%") : "",
|
|
12700
|
+
offset: offset,
|
|
12701
|
+
limit: limit
|
|
12702
|
+
}
|
|
12699
12703
|
};
|
|
12700
12704
|
}
|
|
12701
12705
|
};
|
|
@@ -13043,24 +13047,34 @@ var LOCATION_MASTER_INSERT = createAsyncThunk("locationApiSlice/locationinsert",
|
|
|
13043
13047
|
}, _callee3, null, [[1, 3]]);
|
|
13044
13048
|
})));
|
|
13045
13049
|
var LOCATION_TREE_READ = createAsyncThunk("locationApiSlice/locationtree", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4() {
|
|
13046
|
-
var
|
|
13050
|
+
var payload,
|
|
13051
|
+
_ref8,
|
|
13047
13052
|
rejectWithValue,
|
|
13053
|
+
_payload$search,
|
|
13054
|
+
search,
|
|
13055
|
+
_payload$offset,
|
|
13056
|
+
offset,
|
|
13057
|
+
_payload$limit,
|
|
13058
|
+
limit,
|
|
13048
13059
|
data,
|
|
13049
13060
|
_args4 = arguments,
|
|
13050
13061
|
_t4;
|
|
13051
13062
|
return _regenerator().w(function (_context4) {
|
|
13052
13063
|
while (1) switch (_context4.p = _context4.n) {
|
|
13053
13064
|
case 0:
|
|
13065
|
+
payload = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {};
|
|
13054
13066
|
_ref8 = _args4.length > 1 ? _args4[1] : undefined, rejectWithValue = _ref8.rejectWithValue;
|
|
13055
13067
|
_context4.p = 1;
|
|
13068
|
+
_payload$search = payload.search, search = _payload$search === void 0 ? "" : _payload$search, _payload$offset = payload.offset, offset = _payload$offset === void 0 ? 0 : _payload$offset, _payload$limit = payload.limit, limit = _payload$limit === void 0 ? 10 : _payload$limit;
|
|
13056
13069
|
_context4.n = 2;
|
|
13057
13070
|
return fetchData({
|
|
13058
|
-
body: JSON.stringify(queries$n.locationtree())
|
|
13071
|
+
body: JSON.stringify(queries$n.locationtree(search, offset, limit))
|
|
13059
13072
|
}, __baseUrl__$1);
|
|
13060
13073
|
case 2:
|
|
13061
13074
|
data = _context4.v;
|
|
13062
13075
|
return _context4.a(2, _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
|
|
13063
|
-
data: data
|
|
13076
|
+
data: data,
|
|
13077
|
+
offset: offset
|
|
13064
13078
|
}));
|
|
13065
13079
|
case 3:
|
|
13066
13080
|
_context4.p = 3;
|
|
@@ -13100,7 +13114,28 @@ var locationSlice = createSlice({
|
|
|
13100
13114
|
builder.addCase(LOCATION_TREE_READ.fulfilled, function (state, action) {
|
|
13101
13115
|
state.location_tree.loading = false;
|
|
13102
13116
|
state.location_tree.error = false;
|
|
13103
|
-
|
|
13117
|
+
var isLoadMore = action.payload.offset > 0;
|
|
13118
|
+
if (isLoadMore) {
|
|
13119
|
+
var currentData = state.location_tree.data || [];
|
|
13120
|
+
var newData = action.payload.data || [];
|
|
13121
|
+
var mergedData = _toConsumableArray(currentData);
|
|
13122
|
+
newData.forEach(function (newOrgObj) {
|
|
13123
|
+
var orgName = Object.keys(newOrgObj)[0];
|
|
13124
|
+
var existingOrgIndex = mergedData.findIndex(function (org) {
|
|
13125
|
+
return Object.keys(org)[0] === orgName;
|
|
13126
|
+
});
|
|
13127
|
+
if (existingOrgIndex !== -1) {
|
|
13128
|
+
mergedData[existingOrgIndex][orgName] = [].concat(_toConsumableArray(mergedData[existingOrgIndex][orgName]), _toConsumableArray(newOrgObj[orgName]));
|
|
13129
|
+
} else {
|
|
13130
|
+
mergedData.push(newOrgObj);
|
|
13131
|
+
}
|
|
13132
|
+
});
|
|
13133
|
+
state.location_tree = _objectSpread2(_objectSpread2({}, action.payload), {}, {
|
|
13134
|
+
data: mergedData
|
|
13135
|
+
});
|
|
13136
|
+
} else {
|
|
13137
|
+
state.location_tree = action.payload;
|
|
13138
|
+
}
|
|
13104
13139
|
});
|
|
13105
13140
|
builder.addCase(LOCATION_TREE_READ.pending, function (state) {
|
|
13106
13141
|
state.location_tree.loading = true;
|