updateDepot method

Future<void> updateDepot(
  1. Depot data
)

Update a depot

This function sends a request to the API client to update a depot. If the request is successful, it returns void. In case of an error, the error is recorded in Crashlytics and the error is rethrown.

data The data to update the depot with.

Throws an error if the request fails for any reason.

Implementation

Future<void> updateDepot(Depot data) {
  if (data.id == null) {
    throw ArgumentError('Depot id cannot be null');
  }

  return _apiClient.updateDepot(data.id!, data.toJson()).catchError((error) {
    _crashlytics?.recordError(error, StackTrace.current);
    throw error;
  });
}