deleteMedia method

Future deleteMedia(
  1. int mediaID
)

Deletes the media with the given mediaID from the API. Returns true if the API call is successful.

Implementation

Future deleteMedia(int mediaID) async {
  final response = await callApi(endpoint: 'media/$mediaID', method: 'delete');

  if (response.statusCode == 204) {
    return true;
  } else {
    throw Exception('Error : ${response.body}');
  }
}