HabitatMap/AirCasting

View on GitHub
app/javascript/elm/src/Api.elm

Summary

Maintainability
Test Coverage
module Api exposing (exportLink, exportPath)


exportPath : String
exportPath =
    "/api/sessions/export.json"


exportLink : String -> List { session | id : Int } -> String
exportLink email sessions =
    let
        query =
            String.join "&" << List.map ((++) "session_ids[]=" << String.fromInt << .id)
    in
    exportPath ++ "?" ++ query sessions ++ "&email=" ++ email