diff --git a/advanced/part1/src/Api.elm b/advanced/part1/src/Api.elm index 0ce8753..2ac50a0 100644 --- a/advanced/part1/src/Api.elm +++ b/advanced/part1/src/Api.elm @@ -16,9 +16,7 @@ url : List String -> String url paths = -- NOTE: Url.Builder takes care of percent-encoding special URL characters. -- See https://package.elm-lang.org/packages/elm/url/latest/Url#percentEncode - Url.Builder.crossOrigin "https://conduit.productionready.io" - ("api" :: paths) - [] + Url.Builder.relative ("api" :: paths) [] diff --git a/advanced/part1/src/Author.elm b/advanced/part1/src/Author.elm index e369edc..6685cb7 100644 --- a/advanced/part1/src/Author.elm +++ b/advanced/part1/src/Author.elm @@ -208,7 +208,7 @@ decoder : Maybe Cred -> Decoder Author decoder maybeCred = Decode.succeed Tuple.pair |> custom Profile.decoder - |> required "uname" Username.decoder + |> required "username" Username.decoder |> Decode.andThen (decodeFromPair maybeCred) @@ -216,7 +216,8 @@ decodeFromPair : Maybe Cred -> ( Profile, Username ) -> Decoder Author decodeFromPair maybeCred ( prof, uname ) = case maybeCred of Nothing -> - nonViewerDecoder prof uname + -- If you're logged out, you can't be following anyone! + Decode.succeed (IsNotFollowing (UnfollowedAuthor uname prof)) Just cred -> if uname == Cred.username cred then diff --git a/advanced/part1/src/Avatar.elm b/advanced/part1/src/Avatar.elm index 125709a..9317b79 100644 --- a/advanced/part1/src/Avatar.elm +++ b/advanced/part1/src/Avatar.elm @@ -63,4 +63,4 @@ avatarToUrl (Avatar maybeUrl) = defaultPhotoUrl : String defaultPhotoUrl = - "https://static.productionready.io/images/smiley-cyrus.jpg" + "http://localhost:3000/images/smiley-cyrus.jpg" diff --git a/advanced/server/public/images/smiley-cyrus.jpg b/advanced/server/public/images/smiley-cyrus.jpg new file mode 100644 index 0000000..784a6b9 Binary files /dev/null and b/advanced/server/public/images/smiley-cyrus.jpg differ