Explorar el Código

acknowledgeAsAppointmentPro logic fix

Vijayakrishnan Krishnan hace 5 días
padre
commit
5c41116bde
Se han modificado 1 ficheros con 8 adiciones y 6 borrados
  1. 8 6
      app/Http/Controllers/AppointmentController.php

+ 8 - 6
app/Http/Controllers/AppointmentController.php

@@ -319,18 +319,20 @@ class AppointmentController extends Controller
                 'currentRawEndTime' => $appointment->raw_end_time,
                 'currentTimezone' => $appointment->timezone,
             ];
-            $response = $this->callJavaApi('/appointment/'.$action, $data);
-    
+            $response = $this->callJavaApi('/appointment/' . $action, $data);
+
             if(!$response['success']){
                 array_push($failedUids, $uid);
                 array_push($failedMessages, $response['message']);
             }
-            if(count($failedUids)){
-                return $this->fail('Some appointment(s) failed to acknowledge. ' . $failedMessages[0]);
-            }
+        }
 
-            return $this->pass();
+        if(count($failedUids)){
+            return $this->fail('Some appointment(s) failed to acknowledge. ' . $failedMessages[0]);
         }
+
+        return $this->pass('Completed');
+
     }
 
 }