fastn-stack / fastn

🚧 (Alpha stage software) fastn - better way to build websites 🚧
https://fastn.com
GNU Affero General Public License v3.0
466 stars 36 forks source link

`ftd.redirect` not working with `ftd.http` response data #1860

Open siddhantk232 opened 4 months ago

siddhantk232 commented 4 months ago

to reproduce:

-- boolean $success: false

-- ftd.redirect: /
if: { success }

-- ftd.text: click me to get response
$on-click$: call-http()

-- void call-http(opts):
ftd.http-options opts: $opts

ftd.http("http://127.0.0.1:3000/test.json", opts)

-- ftd.http-options opts:
redirect: follow
method: POST
fastn-module: www.fifthtry.com/signin

clicking on the rendered text should throw: TypeError: ftd.redirect is not a function (see the browser console)

the response from http://127.0.0.1:3000/test.json is:

{
    "data": {
        "success": true
    }
}