delete method
Sends a DELETE
request to delete a resource by its unique identifier.
id
: The unique identifier of the resource to delete.
Returns the data of the deleted resource.
Example usage:
await delete(1);
Implementation
Future delete(int id) async {
try {
final response = await dioClient.delete('$route/$id');
return response.data;
} catch (error) {
AppLogger.error(createErrorResponse(error));
rethrow;
}
}