mirror of
https://github.com/wasp-lang/wasp.git
synced 2024-12-24 17:44:21 +03:00
Formatted with ormolu.
This commit is contained in:
parent
d8bd9ce674
commit
29fd18dbcc
@ -80,7 +80,7 @@ relPosixPathFromOperationsRoutesDirToSrcDir = [reldirP|../..|]
|
||||
|
||||
genOperationsRouter :: Wasp -> FileDraft
|
||||
genOperationsRouter wasp
|
||||
-- TODO: Right now we are throwing error here, but we should instead perform this check in parsing/analyzer phase, as a semantic check, since we have all the info we need then already.
|
||||
-- TODO: Right now we are throwing error here, but we should instead perform this check in parsing/analyzer phase, as a semantic check, since we have all the info we need then already.
|
||||
| usingAuthOnAnyOperation && (not isAuthEnabled) = error "`auth` cannot be specified for specific operations if it is not enabled for the whole app!"
|
||||
| otherwise = C.makeTemplateFD tmplFile dstFile (Just tmplData)
|
||||
where
|
||||
@ -103,10 +103,10 @@ genOperationsRouter wasp
|
||||
"routePath" .= ("/" ++ operationRouteInOperationsRouter operation),
|
||||
"isUsingAuth" .= (isUsingAuth operation)
|
||||
]
|
||||
|
||||
|
||||
isAuthEnabled = (isJust $ getAuth wasp)
|
||||
isUsingAuth :: Wasp.Operation.Operation -> Bool
|
||||
isUsingAuth op = (Wasp.Operation.getAuth op /= Just False)
|
||||
isUsingAuth op = (Wasp.Operation.getAuth op /= Just False)
|
||||
|
||||
operationRouteInOperationsRouter :: Wasp.Operation.Operation -> String
|
||||
operationRouteInOperationsRouter = U.camelToKebabCase . Wasp.Operation.getName
|
||||
|
@ -3,7 +3,7 @@ module Wasp.Operation
|
||||
getName,
|
||||
getJsFn,
|
||||
getEntities,
|
||||
getAuth
|
||||
getAuth,
|
||||
)
|
||||
where
|
||||
|
||||
@ -34,4 +34,4 @@ getEntities (ActionOp action) = Action._entities action
|
||||
|
||||
getAuth :: Operation -> Maybe Bool
|
||||
getAuth (QueryOp query) = Query._auth query
|
||||
getAuth (ActionOp action) = Action._auth action
|
||||
getAuth (ActionOp action) = Action._auth action
|
||||
|
Loading…
Reference in New Issue
Block a user