Cancel Consultation
cancelConsultation
When the consultation is created, its status will be new.
When accepted by a doctor, it will be in_progress.
The consultation can be canceled from the user side by using cancelConsultation
with providing the consultation_id.
Parameters
- consultation_id: (number) - The ID of the consultation to cancel.
Returns
Promise<ResponseType<{ consultation_id: number; status: string }>>: A promise that resolves with an object containing theconsultation_idand the updatedstatusof the consultation.
Example
import { cancelConsultation } from 'react-native-altibbi';
const response = await cancelConsultation(123);
console.log(response.data.consultation_id); // 123
console.log(response.data.status); // "closed"
Responses
Status 200
Success
{
"consultation_id": 123,
"status": "closed"
}
Status 401
UnauthorizedHttpException represents an Unauthorized HTTP exception with status code 401.
{
"name": "Unauthorized",
"message": "Your request was made with invalid credentials",
"code": "0",
"status": "401",
"type": "yii\\web\\UnauthorizedHttpException"
}
Status 403
Current user can't access this page.
{
"name": "Forbidden",
"message": "duplicate request OR Current user cant access this page",
"code": "0",
"status": "403",
"type": "yii\\web\\ForbiddenHttpException"
}
Status 404
Consultation ID invalid or deleted.
{
"name": "Not Found",
"message": "Object not found: {id}",
"code": "0",
"status": "404",
"type": "yii\\web\\NotFoundHttpException"
}