From 25334080b9bcdf238f75069feb92fba65896da5e Mon Sep 17 00:00:00 2001 From: William Carroll Date: Sun, 2 Aug 2020 16:07:35 +0100 Subject: Support POST /invite Allow Admin accounts to invite users to the application. --- src/Invitations.hs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/Invitations.hs (limited to 'src/Invitations.hs') 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) -- cgit 1.4.1