Fix import of contact on already existing contacts

This commit is contained in:
osaajani 2020-06-13 19:10:55 +02:00
parent aa4e528778
commit cc1a85f030
1 changed files with 20 additions and 6 deletions

View File

@ -162,10 +162,17 @@ namespace controllers\internals;
}
$datas = json_encode($datas);
$success = $this->create($id_user, $line['number'], $line['name'], $datas);
if ($success)
try
{
++$nb_insert;
$success = $this->create($id_user, $line['number'], $line['name'], $datas);
if ($success)
{
++$nb_insert;
}
}
catch (\Exception $e)
{
continue;
}
}
@ -218,10 +225,17 @@ namespace controllers\internals;
$datas = $contact['datas'] ?? [];
$datas = json_encode($datas);
$success = $this->create($id_user, $contact['number'], $contact['name'], $datas);
if ($success)
try
{
++$nb_insert;
$success = $this->create($id_user, $contact['number'], $contact['name'], $datas);
if ($success)
{
++$nb_insert;
}
}
catch (\Exception $e)
{
continue;
}
}