getInvoice method

  1. @override
Future getInvoice({
  1. required String invoiceId,
  2. required dynamic token,
})
override

Implementation

@override
Future<dynamic> getInvoice(
    {required final String invoiceId, required final token}) async {
  _dio.options.headers['Authorization'] = 'Bearer $token';
  _dio.options.queryParameters['id'] = invoiceId;

  try {
    final response = await _dio.get('/Invoice/getbyid');
    return response.data;
  } on DioException catch (e) {
    if (e.response != null) {
      return e.response;
    } else {
      throw e.message.toString();
    }
  }
}