title: Vapor how to transform EventLoopFuture<Type> to <Type>
body: <p>I am implementing a delete route handler using Vapor Fluent.</p>
  <p>For this handler, I wanted to verify that the <code>user</code> sending the product deletion request is the owner of the <code>product</code>, and <code>Abort</code> the request otherwise.</p>
  <pre><code>func deleteHandler(_ req: Request) throws -&gt; EventLoopFuture&lt;HTTPStatus&gt; {
      let user = req.auth.get(User.self)
      return Product.find(req.parameters.get(&quot;productID&quot;), on: req.db)
          .unwrap(or: Abort(.notFound))
          .flatMap { product in
              return product.$user.get(on: req.db).flatMapThrowing { owner in
                  guard try user?.requireID() == owner.requireID() else {
                      throw Abort(.forbidden)
                  }
                  return try product.delete(on: req.db)
                      .transform(to: HTTPStatus.noContent) // error here
              }
          }
  }
  </code></pre>
  <p>But Vapor throws an error at <code>return try product.delete(on: req.db).transform(to: HTTPStatus.noContent)</code> saying <code>Cannot convert return expression of type 'EventLoopFuture&lt;HTTPResponseStatus&gt;' to return type 'HTTPStatus' (aka 'HTTPResponseStatus')</code>.</p>
  <p>I tried chaining again using <code>map({})</code>, that did not help. Using <code>wait()</code>solves the error but introduces a runtime bug.</p>
  <p>Thanks for any help!</p>