Update Patient Create, Transtatus
This commit is contained in:
parent
8acfac74d9
commit
fcf910f987
@ -129,6 +129,9 @@ class Patient extends Controller {
|
||||
"DeathDateTime" => $input['DeathDateTime'] ?? null,
|
||||
"CreateDate" => date('Y-m-d H:i:s'),
|
||||
"DelDate" => null,
|
||||
// Linkto
|
||||
// Mother
|
||||
// AccountNumber
|
||||
];
|
||||
|
||||
$rulesDataPatient = [
|
||||
@ -185,7 +188,11 @@ class Patient extends Controller {
|
||||
$this->db->transComplete();
|
||||
|
||||
if ($this->db->transStatus() === false) {
|
||||
return $this->failServerError('Failed to create patient data (transaction rolled back)');
|
||||
$dbError = $this->db->error(); // ambil error terakhir
|
||||
return $this->failServerError(
|
||||
'Failed to create patient data (transaction rolled back): ' .
|
||||
($dbError['message'] ?? 'Unknown database error')
|
||||
);
|
||||
}
|
||||
|
||||
return $this->respondCreated([
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user