@@ -31,25 +31,6 @@ data SegmentType = Static String -- ^ a static path segment. like "/foo"
3131 | Cap Arg -- ^ a capture. like "/:userid"
3232 deriving (Eq, Show)
3333
34−isCapture :: Segment -> Bool
35−isCapture (Cap _) = True
36−isCapture _ = False
37−
38−captureArg :: Segment -> Arg
39−captureArg (Cap s) = s
40−captureArg _ = error "captureArg called on non capture"
41−
42−jsSegments :: [Segment] -> String
43−jsSegments [] = "/'"
44−jsSegments [x] = "/" ++ segmentToStr x False
45−jsSegments (x:xs) = "/" ++ segmentToStr x True ++ jsSegments xs
46−
47−segmentToStr :: Segment -> Bool -> String
48−segmentToStr (Static s) notTheEnd =
49− if notTheEnd then s else s ++ "'"
50−segmentToStr (Cap s) notTheEnd =
51− "' + encodeURIComponent(" ++ s ++ if notTheEnd then ") + '" else ")"
52−
5334type Path = [Segment]
5435
5536data ArgType =
@@ -305,7 +286,7 @@ instance (KnownSymbol sym, HasJQ sublayout)
305286
306287 jqueryFor Proxy req =
307288 jqueryFor (Proxy :: Proxy sublayout) $
308− req & reqUrl.path._last.matrix <>~ [QueryArg str Normal]
289+ req & reqUrl.path._last.matrix <>~ [QueryArg strArg Normal]
309290
310291 where str = symbolVal (Proxy :: Proxy sym)
311292 strArg = str ++ "Value"