Skip to content

Commit 7beed94

Browse files
committed
refactor: allow skip remove for addOrUpdateList
1 parent 45dd95d commit 7beed94

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/service-module/service-module.actions.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,8 @@ export default function makeServiceActions(service: Service<any>) {
289289
const toRemove = []
290290
const { idField, autoRemove } = state
291291

292+
const disableRemove = response.disableRemove || !autoRemove
293+
292294
list.forEach(item => {
293295
const id = getId(item, idField)
294296
const existingItem = state.keyedById[id]
@@ -298,7 +300,7 @@ export default function makeServiceActions(service: Service<any>) {
298300
}
299301
})
300302

301-
if (!isPaginated && autoRemove) {
303+
if (!isPaginated && !disableRemove) {
302304
// Find IDs from the state which are not in the list
303305
state.ids.forEach(id => {
304306
if (!list.some(item => getId(item, idField) === id)) {

0 commit comments

Comments
 (0)