household member editor: do not add in new members if the member is included in the members of household

This commit is contained in:
nobohan 2021-12-13 14:36:08 +01:00
parent f2c724726a
commit 159dba0dc3

View File

@ -224,6 +224,7 @@ const store = createStore({
} }
state.concerned.forEach((c, index) => { state.concerned.forEach((c, index) => {
if (!(h.members.map((m) => m.person.id)).includes(c.person.id)) {
let m = { let m = {
id: index * -1, id: index * -1,
person: c.person, person: c.person,
@ -236,6 +237,8 @@ const store = createStore({
} }
} }
h.new_members.push(m); h.new_members.push(m);
}
}) })
console.log('fake household', h); console.log('fake household', h);