updateApplication method

Future<Response?> updateApplication({
  1. required Announcement data,
  2. GeneralCallback<Response>? callback,
})

Implementation

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