From a972058d20b773f4488df51babb40156c5a335e1 Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Fri, 29 Oct 2021 15:22:52 +0300 Subject: Add feed --- src/Types.elm | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'src/Types.elm') diff --git a/src/Types.elm b/src/Types.elm index de1cccf..02e1257 100644 --- a/src/Types.elm +++ b/src/Types.elm @@ -1,21 +1,30 @@ module Types exposing (..) +import Http +import Time + type alias Model = { posts : List Post , displayError : DisplayableError + , now : Time.Posix } type Msg = NoOp - | FetchPostsSuccess (List Post) - | FetchPostsFailure DisplayableError + -- TIME + | SetNowPosix Time.Posix + -- POSTS + | GetPosts + | GotPosts (Result Http.Error (List Post)) + | LikePost Post + | LikedPost (Result Http.Error Post) type DisplayableError - = Error String - | NoError + = DHttpError Http.Error + | DNoError type alias Author = @@ -28,4 +37,6 @@ type alias Post = { id : String , content : String , author : Author + , createdAt : Time.Posix + , likes : Int } -- cgit v1.3