update method
Updates an existing entity.
Parameters:
entity
: The entity to update.
Returns:
- A Future that resolves to the updated entity of type
T
.
Implementation
Future<T> update(T entity) async {
return dio
.post(
"/update",
data: entity.toJSON(),
)
.then(
(response) => response.body<T>(),
);
}