addReport method

Future<Response> addReport({
  1. required int? typeId,
  2. required int? userId,
  3. required int? postId,
})

Implementation

Future<http.Response> addReport(
    {required int? typeId, required int? userId, required int? postId}) {
  var data = json.encode({"type": typeId, "user": userId, "post": postId});
  log(data);
  return post(Uri.parse('$apiURL/reports/create'),
      headers: {
        "token":
            "cnejwi8c9wehnd8fchni2x239jxexnjx2n23i8xn3oifr0cwd32fjnrf453vreve",
        "content-type": 'application/json',
      },
      body: data);
}