update :: (Entity e, ToJSON e) => e -> AppM e
update e = do
    url <- docURL (view (entityID e) e)
    req <- buildReq url "PUT" (Just e)
    res <- httpJSON req
    return $ e & (entityRev e) .~ (Just $ curRev res)
update :: (Entity e, ToJSON e) => e -> AppM e
update e = do
    url <- docURL (view (entityID e) e)
    req <- buildReq url "PUT" (Just e)
    res <- httpJSON req
    return $ e & (entityRev e) .~ (Just $ curRev res)
update e = do
    url <- docURL (view (entityID e) e)
    req <- buildReq url "PUT" (Just e)
    res <- httpJSON req
    return $ e & (entityRev e) .~ (Just $ curRev res)