Add patient SMS/email messaging and fix Meet video visit errors.
Deploy Ladill Care / deploy (push) Successful in 43s
Deploy Ladill Care / deploy (push) Successful in 43s
Wire Care to Ladill SMS and Bird management APIs on the patient page, and surface Meet auth/config failures as friendly validation errors instead of a 502 page. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -56,6 +56,12 @@ class MeetClient
|
||||
*/
|
||||
private function post(string $path, array $data): array
|
||||
{
|
||||
if (trim((string) config('meet.key')) === '') {
|
||||
throw ValidationException::withMessages([
|
||||
'meet' => ['Video visits are not configured. Set MEET_API_KEY_CARE on Care and Meet to the same value.'],
|
||||
]);
|
||||
}
|
||||
|
||||
try {
|
||||
$response = $this->client()->post($path, $data);
|
||||
} catch (ConnectionException) {
|
||||
@@ -70,8 +76,26 @@ class MeetClient
|
||||
);
|
||||
}
|
||||
|
||||
if ($response->status() === 401 || $response->status() === 403) {
|
||||
throw ValidationException::withMessages([
|
||||
'meet' => ['Video visits are not authorized. Set the same MEET_API_KEY_CARE on Care and Meet, then clear config cache.'],
|
||||
]);
|
||||
}
|
||||
|
||||
if ($response->status() === 404) {
|
||||
throw ValidationException::withMessages([
|
||||
'meet' => ['No Meet workspace was found for this account. Sign into meet.ladill.com once to create one, then retry.'],
|
||||
]);
|
||||
}
|
||||
|
||||
if ($response->failed()) {
|
||||
abort($response->status() === 404 ? 404 : 502, 'Meet service error.');
|
||||
$message = $response->json('error')
|
||||
?? $response->json('message')
|
||||
?? 'Meet could not schedule this video visit. Please try again.';
|
||||
|
||||
throw ValidationException::withMessages([
|
||||
'meet' => [is_string($message) ? $message : 'Meet service error.'],
|
||||
]);
|
||||
}
|
||||
|
||||
return (array) $response->json();
|
||||
|
||||
Reference in New Issue
Block a user