databrary-1: Databrary

Safe HaskellNone
LanguageHaskell2010

Controller.Angular

Contents

Synopsis

Documentation

data JSOpt Source #

Instances

jsURL Source #

Arguments

:: JSOpt

The value to use for the 'js' param in the modified query string.

-> Request

Incoming request where we get the original query string.

FIXME: Just take the string itself, rather than the whole request.

-> (JSOpt, Builder)

The extracted value of the original 'js' param, plus a new query string with the original param overridden.

Extract any 'js' query param, passing its value back as the first part of the tuple. Also return a modified query string (builder) that sets the 'js' param to the value specified as the first argument to this function.

angular :: Handler () Source #

Do or do not send the SPA. There is no try.

The decision is based on enableAngular, via angularRequest, which confusingly returns a query string with which the user could override the use of angular on a subsequent request.

If the SPA is sent, the result machinery causes a short-circuit, ignoring any following actions in this Handler. If the SPA isn't sent, then nothing happens whatsoever right here, and the rest of the Handler may proceed.

Used by servant

angularRequest :: Request -> Maybe Builder Source #

Shall this be an Angular-enabled response? If so, return a modified query string (builder) that can be used to force an Angular-disabled view.