Skip to content

Instantly share code, notes, and snippets.

@ptkato
Created June 4, 2017 18:59
Show Gist options
  • Save ptkato/34a5824a607d444b446d4d3dfb94233c to your computer and use it in GitHub Desktop.
Save ptkato/34a5824a607d444b446d4d3dfb94233c to your computer and use it in GitHub Desktop.
patchAgendamento :: Handler Value
patchAgendamento = do
horarioNovo <- requireJsonBody :: Handler UTCTime
valores <- runDB $ selectList [] [Asc AgendamentoHorario]
runDB $ mapM_ (\chave -> update chave [AgendamentoHorario =. hoarioNovo]) valores
sendStatusJSON noContent204 $ object emptyObject
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment