getLogContent method

void getLogContent({
  1. required String logId,
  2. required dynamic onOk(
    1. List<LogContentResponse> r
    ),
  3. required VoidCallback onError,
  4. dynamic onException(
    1. Exception
    )?,
})

Implementation

void getLogContent({
  required final String logId,
  required final Function(List<LogContentResponse> r) onOk,
  required final VoidCallback onError,
  final Function(Exception)? onException,
}) =>
    httpClient.post(
      "/api/logs/content",
      body: <String, String>{"id": logId},
      onSuccess: (final String r) => onOk(json.decode(r).map((dynamic e) => LogContentResponse.fromMap(e)).toList()),
      onError: (final String r) => onError(),
      onException: (dynamic e) {
        if (onException != null) onException(e);
      },
    );