aboutsummaryrefslogtreecommitdiff
path: root/common/src/Common/Model
diff options
context:
space:
mode:
authorJoris2018-11-01 13:14:25 +0100
committerJoris2019-08-04 21:14:32 +0200
commit2741f47ef7b87255203bc2f7f7b2b9140c70b8f0 (patch)
treeea5f685cdf8f3de2efa1113325d45faaa90c977e /common/src/Common/Model
parent86957359ecf54c205aee1c09e151172c327e987a (diff)
Implementing client side validation
Diffstat (limited to 'common/src/Common/Model')
-rw-r--r--common/src/Common/Model/Email.hs12
-rw-r--r--common/src/Common/Model/SignInForm.hs (renamed from common/src/Common/Model/SignIn.hs)10
2 files changed, 17 insertions, 5 deletions
diff --git a/common/src/Common/Model/Email.hs b/common/src/Common/Model/Email.hs
new file mode 100644
index 0000000..e938f83
--- /dev/null
+++ b/common/src/Common/Model/Email.hs
@@ -0,0 +1,12 @@
+module Common.Model.Email
+ ( Email(..)
+ ) where
+
+import Data.Aeson (FromJSON, ToJSON)
+import Data.Text (Text)
+import GHC.Generics (Generic)
+
+newtype Email = Email Text deriving (Show, Generic)
+
+instance FromJSON Email
+instance ToJSON Email
diff --git a/common/src/Common/Model/SignIn.hs b/common/src/Common/Model/SignInForm.hs
index bfd7fbc..2b8c955 100644
--- a/common/src/Common/Model/SignIn.hs
+++ b/common/src/Common/Model/SignInForm.hs
@@ -1,14 +1,14 @@
-module Common.Model.SignIn
- ( SignIn(..)
+module Common.Model.SignInForm
+ ( SignInForm(..)
) where
import Data.Aeson (FromJSON, ToJSON)
import Data.Text (Text)
import GHC.Generics (Generic)
-data SignIn = SignIn
+data SignInForm = SignInForm
{ _signIn_email :: Text
} deriving (Show, Generic)
-instance FromJSON SignIn
-instance ToJSON SignIn
+instance FromJSON SignInForm
+instance ToJSON SignInForm