Swap part6 and part7

This commit is contained in:
Richard Feldman
2018-08-13 07:36:10 -04:00
parent bc62d92609
commit 59ad6c4c0a
4 changed files with 28 additions and 28 deletions

View File

@@ -206,17 +206,14 @@ toggleFollowButton txt extraClasses msgWhenClicked uname =
decoder : Maybe Cred -> Decoder Author
decoder maybeCred =
{- 👉 TODO: Use this `Profile` and `Username` to decode an `Author`!
💡 HINT: `decoderHelp` will help here, but slightly altering its type may make things easier...
-}
Decode.succeed "..."
Decode.succeed Tuple.pair
|> custom Profile.decoder
|> required "username" Username.decoder
|> Decode.andThen (decodeFromPair maybeCred)
decoderHelp : Maybe Cred -> Profile -> Username -> Decoder Author
decoderHelp maybeCred prof uname =
decodeFromPair : Maybe Cred -> ( Profile, Username ) -> Decoder Author
decodeFromPair maybeCred ( prof, uname ) =
case maybeCred of
Nothing ->
-- If you're logged out, you can't be following anyone!