1
0
Fork 0
mirror of https://code.sup39.dev/repos/Wqawg synced 2025-03-20 04:46:22 +09:00

Add Ticket to persistent model

This commit is contained in:
fr33domlover 2016-04-30 20:40:33 +00:00
parent dbf0c5a2cb
commit 5f909bd3b3
3 changed files with 21 additions and 8 deletions
src/Vervis

View file

@ -38,10 +38,11 @@ checkIdentTemplate =
checkIdentUnique :: SharerId -> Field Handler Text -> Field Handler Text
checkIdentUnique sid = checkM $ \ ident -> do
let project = Project
{ projectIdent = ident
, projectSharer = sid
, projectName = Nothing
, projectDesc = Nothing
{ projectIdent = ident
, projectSharer = sid
, projectName = Nothing
, projectDesc = Nothing
, projectNextTicket = 0
}
mup <- runDB $ checkUnique project
return $ if isNothing mup

View file

@ -28,6 +28,7 @@ newProjectAForm sid = Project
<*> pure sid
<*> aopt textField "Name" Nothing
<*> aopt textField "Description" Nothing
<*> pure 0
newProjectForm :: SharerId -> Form Project
newProjectForm = renderDivs . newProjectAForm