1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-19 02:27:03 +00:00

ui: Move REST API calls into new Api module

This commit is contained in:
James Hillyerd
2018-12-14 20:58:42 -08:00
parent f12a72871f
commit bc427e237f
4 changed files with 114 additions and 75 deletions

View File

@@ -1,5 +1,6 @@
module Page.Home exposing (Model, Msg, init, update, view)
import Api
import Data.Session as Session exposing (Session)
import Html exposing (..)
import Html.Attributes exposing (..)
@@ -19,14 +20,7 @@ type alias Model =
init : ( Model, Cmd Msg, Session.Msg )
init =
let
cmdGreeting =
Http.get
{ url = "/serve/greeting"
, expect = Http.expectString GreetingLoaded
}
in
( Model "", cmdGreeting, Session.none )
( Model "", Api.getGreeting GreetingLoaded, Session.none )