mirror of
https://github.com/wasp-lang/wasp.git
synced 2024-12-24 17:44:21 +03:00
generate userEntityLower for signup.js
This commit is contained in:
parent
4e95c4dcda
commit
7eca9b37a3
@ -18,7 +18,7 @@ genAuth wasp = case maybeAuth of
|
||||
-- Auth routes
|
||||
, genAuthRoutesIndex
|
||||
, genLoginRoute auth
|
||||
, genSignupRoute
|
||||
, genSignupRoute auth
|
||||
, genMeRoute auth
|
||||
]
|
||||
Nothing -> []
|
||||
@ -53,8 +53,16 @@ genLoginRoute auth = C.makeTemplateFD tmplFile dstFile (Just tmplData)
|
||||
, "userEntityLower" .= Util.toLowerFirst userEntity
|
||||
]
|
||||
|
||||
genSignupRoute :: FileDraft
|
||||
genSignupRoute = C.copySrcTmplAsIs (C.asTmplSrcFile [P.relfile|routes/auth/signup.js|])
|
||||
genSignupRoute :: Wasp.Auth.Auth -> FileDraft
|
||||
genSignupRoute auth = C.makeTemplateFD tmplFile dstFile (Just tmplData)
|
||||
where
|
||||
signupRouteRelToSrc = [P.relfile|routes/auth/signup.js|]
|
||||
tmplFile = C.asTmplFile $ [P.reldir|src|] P.</> signupRouteRelToSrc
|
||||
dstFile = C.serverSrcDirInServerRootDir </> (C.asServerSrcFile signupRouteRelToSrc)
|
||||
|
||||
tmplData = object
|
||||
[ "userEntityLower" .= Util.toLowerFirst (Wasp.Auth._userEntity auth)
|
||||
]
|
||||
|
||||
genMeRoute :: Wasp.Auth.Auth -> FileDraft
|
||||
genMeRoute auth = C.makeTemplateFD tmplFile dstFile (Just tmplData)
|
||||
|
Loading…
Reference in New Issue
Block a user