add challenge
This commit is contained in:
parent
62bd9a514f
commit
c1ed05edf0
@ -33,9 +33,25 @@ doCreateChallenge name publicUrl publicBranch privateUrl privateBranch chan = do
|
|||||||
case maybePublicRepoId of
|
case maybePublicRepoId of
|
||||||
Just publicRepoId -> do
|
Just publicRepoId -> do
|
||||||
maybePrivateRepoId <- cloneRepo privateUrl privateBranch chan
|
maybePrivateRepoId <- cloneRepo privateUrl privateBranch chan
|
||||||
return ()
|
case maybePrivateRepoId of
|
||||||
|
Just privateRepoId -> addChallenge name publicRepoId privateRepoId chan
|
||||||
|
Nothing -> return ()
|
||||||
Nothing -> return ()
|
Nothing -> return ()
|
||||||
|
|
||||||
|
addChallenge :: Text -> (Key Repo) -> (Key Repo) -> Channel -> Handler ()
|
||||||
|
addChallenge name publicRepoId privateRepoId chan = do
|
||||||
|
msg chan "adding challenge..."
|
||||||
|
time <- liftIO getCurrentTime
|
||||||
|
challengeId <- runDB $ insert $ Challenge {
|
||||||
|
challengePublicRepo=publicRepoId,
|
||||||
|
challengePrivateRepo=privateRepoId,
|
||||||
|
challengeName=name,
|
||||||
|
challengeTitle="[UNKNOWN TITLE]",
|
||||||
|
challengeDescription="[UNKNOWN DESCRIPTION]",
|
||||||
|
challengeStamp=time}
|
||||||
|
return ()
|
||||||
|
|
||||||
|
|
||||||
sampleForm :: Form (Text, Text, Text, Text, Text)
|
sampleForm :: Form (Text, Text, Text, Text, Text)
|
||||||
sampleForm = renderBootstrap3 BootstrapBasicForm $ (,,,,)
|
sampleForm = renderBootstrap3 BootstrapBasicForm $ (,,,,)
|
||||||
<$> areq textField (fieldSettingsLabel MsgName) Nothing
|
<$> areq textField (fieldSettingsLabel MsgName) Nothing
|
||||||
|
Loading…
Reference in New Issue
Block a user