all repos

onasty @ a64006944ac021bf0a655564d8016f87f4b20c3b

a one-time notes service

onasty/web/src/Api/Me.elm(view raw)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
module Api.Me exposing (get)

import Api
import Data.Me as Me exposing (Me)
import Effect exposing (Effect)
import Http


get : { onResponse : Result Api.Error Me -> msg } -> Effect msg
get options =
    Effect.sendApiRequest
        { endpoint = "/api/v1/me"
        , method = "GET"
        , body = Http.emptyBody
        , onResponse = options.onResponse
        , decoder = Me.decode
        }