Skip to content

Commit 0048548

Browse files
committed
renaming createPost and PostId with createTweet and TweetId respectively
1 parent 24a4f51 commit 0048548

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/FsTweet.Web/Tweet.fs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ namespace Tweet
22
open User
33
open Chessie.ErrorHandling
44

5-
type PostId = PostId of System.Guid
5+
type TweetId = TweetId of System.Guid
66

77
type Post = private Post of string with
88
static member TryCreate (post : string) =
@@ -14,7 +14,7 @@ type Post = private Post of string with
1414
let (Post post) = this
1515
post
1616

17-
type CreatePost = UserId -> Post -> AsyncResult<PostId, System.Exception>
17+
type CreatePost = UserId -> Post -> AsyncResult<TweetId, System.Exception>
1818

1919

2020
module Persistence =
@@ -23,16 +23,16 @@ module Persistence =
2323
open Database
2424
open System
2525

26-
let createPost (getDataCtx : GetDataContext) (UserId userId) (post : Post) = asyncTrial {
26+
let createTweet (getDataCtx : GetDataContext) (UserId userId) (post : Post) = asyncTrial {
2727
let ctx = getDataCtx()
2828
let newTweet = ctx.Public.Tweets.Create()
29-
let newPostId = Guid.NewGuid()
29+
let newTweetId = Guid.NewGuid()
3030

3131
newTweet.UserId <- userId
32-
newTweet.Id <- newPostId
32+
newTweet.Id <- newTweetId
3333
newTweet.Post <- post.Value
3434
newTweet.TweetedAt <- DateTime.UtcNow
3535

3636
do! submitUpdates ctx
37-
return PostId newPostId
37+
return TweetId newTweetId
3838
}

src/FsTweet.Web/Wall.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ module Suave =
2727
return! page "user/wall.liquid" vm ctx
2828
}
2929

30-
let onCreateTweetSuccess (PostId id) =
30+
let onCreateTweetSuccess (TweetId id) =
3131
["id", String (id.ToString())]
3232
|> Map.ofList
3333
|> Object
@@ -53,7 +53,7 @@ module Suave =
5353
}
5454

5555
let webpart getDataCtx =
56-
let createTweet = Persistence.createPost getDataCtx
56+
let createTweet = Persistence.createTweet getDataCtx
5757
choose [
5858
path "/wall" >=> requiresAuth renderWall
5959
POST >=> path "/tweets"

0 commit comments

Comments
 (0)