createInvoice method

  1. @override
Future createInvoice({
  1. required dynamic invoices,
  2. required dynamic token,
})
override

Implementation

@override
Future<dynamic> createInvoice(
    {required final invoices, required final token}) async {
  _dio.options.headers['Authorization'] = 'Bearer $token';
  try {
    final response = await _dio.post('/Invoice/insert', data: invoices);
    return response.data;
  } on DioException catch (e) {
    if (e.response != null) {
      return e.response;
    } else {
      throw e.message.toString();
    }
  }
}