delete method

  1. @override
FutureOr<DeleteDbResult> delete(
  1. Access access
)
override

Implementation

@override
FutureOr<DeleteDbResult> delete(Access access) {
  if (access.identifier == null) {
    throw BadRequests();
  }
  if (data[access.collection]?[access.identifier!] == null) {
    return DeleteDbResult(exists: false);
  } else {
    data[access.collection]!.remove(access.identifier);
    return DeleteDbResult(exists: true);
  }
}