upsertContactsBasedOnId method
Implementation
@action
Future<int> upsertContactsBasedOnId(List<ContactWeebi> data) async {
final twoLists = contacts.findDupsById(newList: data);
if (twoLists.dups.isNotEmpty) {
for (final h in twoLists.dups) {
await updateContact(h);
}
}
if (twoLists.noDups.isNotEmpty) {
await createAllContacts(twoLists.noDups);
}
return twoLists.dups.length + twoLists.noDups.length;
}