getPostAndParentAwaitingApproval static method
Future<PostSearchResponseResponse>
getPostAndParentAwaitingApproval(
- HttpClient client,
- String childPostId,
- String showbanned
Returns the post specified and its immediate parent of posts that are awaiting approval.
Implementation
static Future<PostSearchResponseResponse> getPostAndParentAwaitingApproval (
HttpClient client,
String childPostId,
String showbanned,
) async {
final Map<String, dynamic> params = Map<String, dynamic>();
final String _childPostId = '$childPostId';
params['showbanned'] = showbanned;
final HttpClientConfig config = HttpClientConfig('GET', '/Forum/GetPostAndParentAwaitingApproval/$_childPostId/', params);
config.bodyContentType = null;
final HttpResponse response = await client.request(config);
if(response.statusCode == 200) {
return PostSearchResponseResponse.asyncFromJson(response.mappedBody);
}
throw Exception(response.mappedBody);
}