wt-front-shared 1.0.58 → 1.0.60
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/esm2020/lib/core/+state/static-data/behavios/static-data-get-list-behavior.mjs +4 -3
- package/esm2020/lib/core/+state/static-data/behavios/static-data-get-list-categories-behavior.mjs +4 -4
- package/esm2020/lib/core/+state/static-data/static-data.actions.mjs +1 -1
- package/esm2020/lib/core/+state/static-data/static-data.reducer.mjs +13 -8
- package/fesm2015/wt-front-shared.mjs +9 -3
- package/fesm2015/wt-front-shared.mjs.map +1 -1
- package/fesm2020/wt-front-shared.mjs +14 -8
- package/fesm2020/wt-front-shared.mjs.map +1 -1
- package/lib/core/+state/static-data/behavios/static-data-get-list-categories-behavior.d.ts +3 -3
- package/lib/core/+state/static-data/static-data.actions.d.ts +2 -0
- package/lib/core/+state/static-data/static-data.reducer.d.ts +1 -1
- package/package.json +1 -1
|
@@ -4809,10 +4809,11 @@ class StaticDataGetListBehavior extends Behavior {
|
|
|
4809
4809
|
case ResponseStatus.STATUS_200: {
|
|
4810
4810
|
const response = this.result.data;
|
|
4811
4811
|
const { data, meta } = response.body;
|
|
4812
|
+
const actionPayload = this.action['payload'];
|
|
4812
4813
|
if (data) {
|
|
4813
4814
|
returnedActions = [
|
|
4814
4815
|
StaticDataGetListSuccess({
|
|
4815
|
-
payload: { data, meta }
|
|
4816
|
+
payload: { data, meta, keepState: actionPayload.keepState }
|
|
4816
4817
|
})
|
|
4817
4818
|
];
|
|
4818
4819
|
}
|
|
@@ -5989,10 +5990,10 @@ const _staticDataReducer$2 = createReducer(initialState$3, on(StaticDataGetList,
|
|
|
5989
5990
|
};
|
|
5990
5991
|
}
|
|
5991
5992
|
return {
|
|
5992
|
-
...state
|
|
5993
|
+
...state
|
|
5993
5994
|
};
|
|
5994
5995
|
}), on(StaticDataGetListSuccess, (state, action) => {
|
|
5995
|
-
const { data, meta } = action.payload;
|
|
5996
|
+
const { data, meta, keepState } = action.payload;
|
|
5996
5997
|
const { staticDataType, subSection } = meta;
|
|
5997
5998
|
const newsState = { list: {}, meta: {} };
|
|
5998
5999
|
const storeSubSection = subSection || 'list';
|
|
@@ -6026,7 +6027,12 @@ const _staticDataReducer$2 = createReducer(initialState$3, on(StaticDataGetList,
|
|
|
6026
6027
|
if (!newsState['list'][staticDataType]) {
|
|
6027
6028
|
newsState['list'][staticDataType] = { [storeSubSection]: {} };
|
|
6028
6029
|
}
|
|
6029
|
-
|
|
6030
|
+
if (!keepState) {
|
|
6031
|
+
newsState['list'][staticDataType][storeSubSection] = Array.isArray(data) ? [...data] : [];
|
|
6032
|
+
}
|
|
6033
|
+
else {
|
|
6034
|
+
newsState['list'][staticDataType][storeSubSection] = Array.isArray(data) ? [...state.list[staticDataType][storeSubSection], ...data] : [];
|
|
6035
|
+
}
|
|
6030
6036
|
newsState['meta'][staticDataType] = {
|
|
6031
6037
|
...newsState['meta']?.[staticDataType],
|
|
6032
6038
|
[storeSubSection]: {
|
|
@@ -6045,7 +6051,7 @@ const _staticDataReducer$2 = createReducer(initialState$3, on(StaticDataGetList,
|
|
|
6045
6051
|
};
|
|
6046
6052
|
}
|
|
6047
6053
|
return {
|
|
6048
|
-
...state
|
|
6054
|
+
...state
|
|
6049
6055
|
};
|
|
6050
6056
|
}), on(StaticDataDeleteSuccess, (state, action) => {
|
|
6051
6057
|
const { contentType, itemId } = action.payload;
|
|
@@ -6218,7 +6224,7 @@ const _staticDataReducer$2 = createReducer(initialState$3, on(StaticDataGetList,
|
|
|
6218
6224
|
const newState = {
|
|
6219
6225
|
...state,
|
|
6220
6226
|
meta: {
|
|
6221
|
-
...state.meta
|
|
6227
|
+
...state.meta
|
|
6222
6228
|
}
|
|
6223
6229
|
};
|
|
6224
6230
|
contentTypes.forEach(contentType => {
|
|
@@ -6238,7 +6244,7 @@ const _staticDataReducer$2 = createReducer(initialState$3, on(StaticDataGetList,
|
|
|
6238
6244
|
const newState = {
|
|
6239
6245
|
...state,
|
|
6240
6246
|
meta: {
|
|
6241
|
-
...state.meta
|
|
6247
|
+
...state.meta
|
|
6242
6248
|
}
|
|
6243
6249
|
};
|
|
6244
6250
|
contentTypes.forEach(contentType => {
|
|
@@ -6257,7 +6263,7 @@ const _staticDataReducer$2 = createReducer(initialState$3, on(StaticDataGetList,
|
|
|
6257
6263
|
...state,
|
|
6258
6264
|
list: { ...state.list },
|
|
6259
6265
|
meta: {
|
|
6260
|
-
...state.meta
|
|
6266
|
+
...state.meta
|
|
6261
6267
|
}
|
|
6262
6268
|
};
|
|
6263
6269
|
Object.keys(data).forEach(contentType => {
|