approveApplication method

Future<Response?> approveApplication({
  1. required String? applicationId,
  2. String? reviewDescription,
  3. GeneralCallback<Response>? callback,
})

Implementation

Future<Response<dynamic>?> approveApplication({
  required String? applicationId,
  String? reviewDescription,
  GeneralCallback<Response<dynamic>>? callback,
}) async {
  try {
    final Response<dynamic> response = await dio.put(
      '/application/$applicationId/approve',
      data: <String, String>{
        'description': reviewDescription ?? '',
      },
    );
    if (callback != null) {
      callback.onSuccess(response);
    }
    return response;
  } on DioException catch (dioException) {
    if (callback == null) {
      rethrow;
    } else {
      handleCrudError(dioException, callback);
    }
  }
  return null;
}