Use local URLs etc

This commit is contained in:
Richard Feldman
2018-08-05 06:17:34 -04:00
parent f6bd524cb6
commit 6a3879b1c7
4 changed files with 5 additions and 6 deletions

View File

@@ -16,9 +16,7 @@ url : List String -> String
url paths = url paths =
-- NOTE: Url.Builder takes care of percent-encoding special URL characters. -- NOTE: Url.Builder takes care of percent-encoding special URL characters.
-- See https://package.elm-lang.org/packages/elm/url/latest/Url#percentEncode -- See https://package.elm-lang.org/packages/elm/url/latest/Url#percentEncode
Url.Builder.crossOrigin "https://conduit.productionready.io" Url.Builder.relative ("api" :: paths) []
("api" :: paths)
[]

View File

@@ -208,7 +208,7 @@ decoder : Maybe Cred -> Decoder Author
decoder maybeCred = decoder maybeCred =
Decode.succeed Tuple.pair Decode.succeed Tuple.pair
|> custom Profile.decoder |> custom Profile.decoder
|> required "uname" Username.decoder |> required "username" Username.decoder
|> Decode.andThen (decodeFromPair maybeCred) |> Decode.andThen (decodeFromPair maybeCred)
@@ -216,7 +216,8 @@ decodeFromPair : Maybe Cred -> ( Profile, Username ) -> Decoder Author
decodeFromPair maybeCred ( prof, uname ) = decodeFromPair maybeCred ( prof, uname ) =
case maybeCred of case maybeCred of
Nothing -> Nothing ->
nonViewerDecoder prof uname -- If you're logged out, you can't be following anyone!
Decode.succeed (IsNotFollowing (UnfollowedAuthor uname prof))
Just cred -> Just cred ->
if uname == Cred.username cred then if uname == Cred.username cred then

View File

@@ -63,4 +63,4 @@ avatarToUrl (Avatar maybeUrl) =
defaultPhotoUrl : String defaultPhotoUrl : String
defaultPhotoUrl = defaultPhotoUrl =
"https://static.productionready.io/images/smiley-cyrus.jpg" "http://localhost:3000/images/smiley-cyrus.jpg"

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB