fixing contactdetail empty not delete

This commit is contained in:
mahdahar 2025-09-25 13:42:37 +07:00
parent 501ef06592
commit e5d51dff86
2 changed files with 38 additions and 38 deletions

View File

@ -103,12 +103,12 @@ class Contact extends Controller {
if (!$ContactID) { throw new \RuntimeException('Failed to insert contact'); } if (!$ContactID) { throw new \RuntimeException('Failed to insert contact'); }
} }
if (!empty($input['Details'])) {
$result = $detailModel->syncDetails($ContactID, $input['Details']); $result = $detailModel->syncDetails($ContactID, $input['Details']);
if ($result['status'] !== 'success') { if ($result['status'] !== 'success') {
throw new \RuntimeException('Failed to sync details: ' . $result['message']); throw new \RuntimeException('Failed to sync details: ' . $result['message']);
} }
}
$db->transComplete(); $db->transComplete();