Skip to content

QueryFlag is not encoded correctly #11

Closed
@fizruk

Description

@fizruk

If you try to use QueryFlag you get invalid JavaScript.

The reason is this line in paramToStr function:

paramToStr :: QueryArg f -> Bool -> Text
paramToStr qarg notTheEnd =
  case qarg ^. queryArgType of
    Normal -> name
           <> "=' + encodeURIComponent("
           <> name
           <> if notTheEnd then ") + '" else ")"
    Flag   -> name <> "=" -------------------- BAD CODE HERE
    List   -> name
           <> "[]=' + encodeURIComponent("
           <> name
           <> if notTheEnd then ") + '" else ")"
  where name = qarg ^. queryArgName . argName . _PathSegment

It should be

    Flag   -> name <> "='" -- close the '

or

    Flag   -> name <> "'" -- close the '

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions