deleteById method
Deletes an entity based on its ID.
Parameters:
id
: The ID of the entity to delete.
Returns:
- A Future that resolves to the deleted entity of type
T
.
Implementation
Future<T> deleteById(num id) async {
return dio.post(
"/delete",
data: {
"id": id,
},
).then(
(response) => response.body<T>(),
);
}