SolviQorda / get-zapped

A web app platform for electrolysis therapists to offer services to trans people seeking hair removal.
1 stars 0 forks source link

Build the therapist dashboard - appointment view #4

Closed SolviQorda closed 5 years ago

SolviQorda commented 5 years ago

wireframe: image

SolviQorda commented 5 years ago
SolviQorda commented 5 years ago

Making progress with this - my issue is that I'm not sure how to manage the data when it comes to making more than one request - toPathPiece and MultiPathPiece are probably what I want to be looking.

I think to do this effectively I might need to put my routes in a .hs file? Here is the example

instance PathMultiPiece Page where
    toPathMultiPiece (Page x y z) = x : y : z
    fromPathMultiPiece (x:y:z) = Just $ Page x y z
    fromPathMultiPiece _ = Nothing

data FilterChoice = FilterChoice (Maybe Text) (Maybe Day)

instance PathMultiPiece FilterChoice where toPathMultiPiece (FilterChoice Nothing (Just date)) = alltherapists : date toPathMultiPiece (FilterChoice (Just therapist) Nothing)) = therapist : alldates toPathMultiPiece (FilterChoice (Just therapist) (Just date)) = therapist : date toPathMultiPiece (FilterChoice Nothing Nothing = alltherapists : alldates fromPathMultiPiece (therapist : date) = Just $ FilterChoice therapist date fromPathMultiPiece _ = Nothing where alldates = toEnum 47994 alltherapists = pack "alltherapists"

Where does this code need to go?

SolviQorda commented 5 years ago

Solved with latest commit