diff options
author | William Carroll <wpcarro@gmail.com> | 2020-08-02T15·07+0100 |
---|---|---|
committer | William Carroll <wpcarro@gmail.com> | 2020-08-02T15·07+0100 |
commit | 25334080b9bcdf238f75069feb92fba65896da5e (patch) | |
tree | f3410227de97c10936a260e9e7a6bbe6ac43231d /src/Invitations.hs | |
parent | fe609bbe5804be229a7e5c0d276654fb3e45179b (diff) |
Support POST /invite
Allow Admin accounts to invite users to the application.
Diffstat (limited to 'src/Invitations.hs')
-rw-r--r-- | src/Invitations.hs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/Invitations.hs b/src/Invitations.hs new file mode 100644 index 000000000000..62038bb03646 --- /dev/null +++ b/src/Invitations.hs @@ -0,0 +1,14 @@ +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE RecordWildCards #-} +-------------------------------------------------------------------------------- +module Invitations where +-------------------------------------------------------------------------------- +import Database.SQLite.Simple + +import qualified Types as T +-------------------------------------------------------------------------------- + +create :: FilePath -> T.InvitationSecret -> T.Email -> T.Role -> IO () +create dbFile secret email role = withConnection dbFile $ \conn -> do + execute conn "INSERT INTO Invitations (email,role,secret) VALUES (?,?,?)" + (email, role, secret) |