addApplication method
Future<Response?>
addApplication({
- required Announcement data,
- GeneralCallback<
Response> ? callback, - String? languageCode,
Implementation
Future<Response<dynamic>?> addApplication({
required Announcement data,
GeneralCallback<Response<dynamic>>? callback,
String? languageCode,
}) async {
try {
data.tags ??= <String>[];
data.tags?.addAll(
<String>[
languageCode ?? 'zh',
if (organization != null) organization!,
],
);
final Response<dynamic> response = await dio.post(
'/application',
data: data.toUpdateJson(),
);
if (callback != null) {
callback.onSuccess(response);
}
return response;
} on DioException catch (dioException) {
if (callback == null) {
rethrow;
} else {
handleCrudError(dioException, callback);
}
}
return null;
}