File tree Expand file tree Collapse file tree 1 file changed +2
-10
lines changed
Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Original file line number Diff line number Diff line change @@ -37,22 +37,14 @@ module Suave =
3737 printfn " %A " ex
3838 JSON.internalError
3939
40- let handleCreateTweetResult result =
41- either onCreateTweetSuccess onCreateTweetFailure result
42-
43- let handleAsyncCreateTweetResult aResult =
44- aResult
45- |> Async.ofAsyncResult
46- |> Async.map handleCreateTweetResult
47-
4840 let handleNewTweet createTweet ( user : User ) ctx = async {
4941 match JSON.deserialize ctx.request with
5042 | Success ( PostRequest post) ->
5143 match Post.TryCreate post with
5244 | Success post ->
53- let aCreateTweetResult = createTweet user.UserId post
5445 let! webpart =
55- handleAsyncCreateTweetResult aCreateTweetResult
46+ createTweet user.UserId post
47+ |> AR.either onCreateTweetSuccess onCreateTweetFailure
5648 return ! webpart ctx
5749 | Failure err ->
5850 return ! JSON.badRequest err ctx
You can’t perform that action at this time.
0 commit comments