2G3GNDDUOVPF45PELJ65ZB2IXEHJJXJILFRVHZXGPXUL4BVNZJFQC
PBD7LZYQHXAA3KLH2ZUX5GW4UFML6BQ32KXZF4KZ6OYFASUYFJ5QC
LD4GLVSF6YTA7OZWIGJ45H6TUXGM4WKUIYXKWQFNUP36WDMYSMXAC
IZEVQF627FA7VV25KJAWYWGGC35LZUUBBQRPN5ZAINTQLPEDRTEAC
TNR3TEHKVADAEZSTOD2XLSUTSW5AWST2YUW4CWK5KE7DSC6XHZNAC
I2KHGVD44KT4MQJXGCTVSQKMBO6TVCY72F26TLXGWRL6PHGF6RNQC
ADMKQQGCGVSHHIMVQ4XFRDCG544SBJCYALSKZV45CQQBZ4ACUH2AC
Z7KS5XHHC6PAMTVBHXY7KUSS3BWAOU6FSYIITUCFOOJZU4OUJHBAC
BROSTG5KP3NUNLSYPVQID254TE47E5RKQAKLPIY7PGWETE6JNMTAC
NVOCQVASZWTKQJG7GPH7KHKZZR7NUG4WLV5YY4KAIRPCJRWCZPIAC
(p ^. projectName, p ^. inceptionDate, p ^. (initiator._UserId))
pure . ProjectId . fromOnly $ DL.head pids
(p ^. projectName, p ^. inceptionDate, uid)
let pid = fromOnly $ DL.head pids
void . lift $ execute conn
"INSERT INTO project_companions (project_id, companion_id) VALUES (?, ?)"
(pid, uid)
pure . ProjectId $ pid
curl -v -u "nuttycom:kjntest" -X POST -d '' http://localhost:8000/projects/1/logEnd/1KamUn1BaRMd2HwikyQWGTdUvfPScg9QA5
curl -v -u "nuttycom:kjntest" -X POST -d '' http://localhost:8000/projects/1/logStart/1KamUn1BaRMd2HwikyQWGTdUvfPScg9QA5
, ("register", method POST registerHandler)
, ("projects", projectsHandler)
, ("logStart/:projectId/:btcAddr", logWorkHandler StartWork)
, ("logEnd/:projectId/:btcAddr", logWorkHandler StopWork)
, ("loggedIntervals/:projectId/:btcAddr", loggedIntervalsHandler)
, ("register", void $ method POST registerHandler)
, ("projects/:projectId/logStart/:btcAddr", method POST $ logWorkHandler StartWork)
, ("projects/:projectId/logEnd/:btcAddr", method POST $ logWorkHandler StopWork)
, ("projects/:projectId/log/:btcAddr", method GET loggedIntervalsHandler)
currentUser <- requireLogin
qdbUser <- case UserName . AU.unUid <$> AU.userId currentUser of
Nothing -> snapError 403 "User is authenticated, but session lacks user identifier"
Just n -> liftPG . runReaderT $ findUserByUserName n
currentUser <- UserName . AU.userLogin <$> requireLogin
qdbUser <- liftPG . runReaderT $ findUserByUserName currentUser