diff --git a/waspc/src/Generator/ServerGenerator/OperationsRoutesG.hs b/waspc/src/Generator/ServerGenerator/OperationsRoutesG.hs index 17f20fbb5..baa226ad4 100644 --- a/waspc/src/Generator/ServerGenerator/OperationsRoutesG.hs +++ b/waspc/src/Generator/ServerGenerator/OperationsRoutesG.hs @@ -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 diff --git a/waspc/src/Wasp/Operation.hs b/waspc/src/Wasp/Operation.hs index 622848ec4..87e03803d 100644 --- a/waspc/src/Wasp/Operation.hs +++ b/waspc/src/Wasp/Operation.hs @@ -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 \ No newline at end of file +getAuth (ActionOp action) = Action._auth action