forked from supermario/lamdera-realworld
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Bridge.elm
56 lines (51 loc) · 2.15 KB
/
Bridge.elm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
module Bridge exposing (..)
import Api.Article.Filters exposing (Filters)
import Api.User exposing (User)
import Lamdera
sendToBackend =
Lamdera.sendToBackend
type ToBackend
= SignedOut User
-- Req/resp paired messages
| GetTags_Home_
| ArticleList_Home_ { filters : Filters, page : Int }
| ArticleFeed_Home_ { page : Int }
| ArticleList_Username_ { filters : Filters, page : Int }
| ArticleGet_Editor__ArticleSlug_ { slug : String }
| ArticleGet_Article__Slug_ { slug : String }
| ArticleCreate_Editor
{ article :
{ title : String, description : String, body : String, tags : List String }
}
| ArticleUpdate_Editor__ArticleSlug_
{ slug : String
, updates :
{ title : String, description : String, body : String, tags : List String }
}
| ArticleDelete_Article__Slug_ { slug : String }
| ArticleFavorite_Profile__Username_ { slug : String }
| ArticleUnfavorite_Profile__Username_ { slug : String }
| ArticleFavorite_Home_ { slug : String }
| ArticleUnfavorite_Home_ { slug : String }
| ArticleFavorite_Article__Slug_ { slug : String }
| ArticleUnfavorite_Article__Slug_ { slug : String }
| ArticleCommentGet_Article__Slug_ { articleSlug : String }
| ArticleCommentCreate_Article__Slug_ { articleSlug : String, comment : { body : String } }
| ArticleCommentDelete_Article__Slug_ { articleSlug : String, commentId : Int }
| ProfileGet_Profile__Username_ { username : String }
| ProfileFollow_Profile__Username_ { username : String }
| ProfileUnfollow_Profile__Username_ { username : String }
| ProfileFollow_Article__Slug_ { username : String }
| ProfileUnfollow_Article__Slug_ { username : String }
| UserAuthentication_Login { params : { email : String, password : String } }
| UserRegistration_Register { params : { username : String, email : String, password : String } }
| UserUpdate_Settings
{ params :
{ username : String
, email : String
, password : Maybe String
, image : String
, bio : String
}
}
| NoOpToBackend