fix : SurgeryAppointment
This commit is contained in:
@@ -662,11 +662,20 @@ public static function table(Table $table): Table
|
||||
'surgeryDateFull' => $surgeryDateTime->toDateTimeString(),
|
||||
];
|
||||
|
||||
$appointment = SurgeryAppointment::updateOrCreate(
|
||||
['patient_id' => $record->id],
|
||||
[
|
||||
'surgery_date' => $surgeryDateTime,
|
||||
'surgery_center_id' => $data['surgery_center_id'],
|
||||
]
|
||||
);
|
||||
try {
|
||||
$response = \Illuminate\Support\Facades\Http::timeout(30)
|
||||
->withHeader('X-API-Key', $apiKey)
|
||||
->asJson()
|
||||
->post($apiUrl . '/surgery-reminder', $smsPayload);
|
||||
->post($apiUrl . '/surgery-reminder', array_merge($smsPayload, [
|
||||
'appointmentId' => $appointment->id,
|
||||
]));
|
||||
|
||||
if (! ($response->json('success') ?? false)) {
|
||||
\Filament\Notifications\Notification::make()
|
||||
@@ -689,24 +698,6 @@ public static function table(Table $table): Table
|
||||
return;
|
||||
}
|
||||
|
||||
$appointment = SurgeryAppointment::updateOrCreate(
|
||||
['patient_id' => $record->id],
|
||||
[
|
||||
'surgery_date' => $surgeryDateTime,
|
||||
'surgery_center_id' => $data['surgery_center_id'],
|
||||
]
|
||||
);
|
||||
|
||||
try {
|
||||
\Illuminate\Support\Facades\Http::timeout(30)
|
||||
->withHeader('X-API-Key', $apiKey)
|
||||
->asJson()
|
||||
->post($apiUrl . '/surgery-reminder', array_merge($smsPayload, [
|
||||
'appointmentId' => $appointment->id,
|
||||
]));
|
||||
} catch (\Throwable) {
|
||||
}
|
||||
|
||||
\Filament\Notifications\Notification::make()
|
||||
->title(__('patients.actions.appointment_saved'))
|
||||
->body(__('patients.actions.sms_sent'))
|
||||
|
||||
Reference in New Issue
Block a user