delete static method
deletes a object with id
at collection
Implementation
static Future<Map<String, dynamic>> delete({
required String collection,
required String id,
}) async {
final path = collection + "/$id";
final response = await Strapi.i.request(
path,
method: "DELETE",
);
if (response.failed) {
throw StrapiResponseException(
"failed to delete at collection $collection for id :$id",
response,
);
}
return response.body.isNotEmpty ? response.body.first : {};
}