Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ftd.http): replicate error response behaviour for data response #1822

Merged
merged 1 commit into from
Mar 25, 2024

Conversation

siddhantk232
Copy link
Contributor

For the errors response from server, ftd.http correctly prepends defined
variables with the fastn-module name provided through ftd.http-options.

The same thing is not done for data response. This PR fixes this.

E.g.

-- optional string $name:

-- ftd.text: $name
if: { name }

-- ftd.text: test
$on-click$: send-req()

-- ftd.http-options opts:
method: GET
fastn-module: fastn-test-multiauth/

-- void send-req():
ftd.http-options opts: $opts

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

The response from the server (http://localhost:3000/test.json):

{
    "data": {
        "name": "spiderman"
    }
}

The ftd.text shows "spiderman" with this change.

@amitu amitu merged commit adfbd1d into main Mar 25, 2024
1 check passed
@amitu amitu deleted the fix/ftd-http-data branch March 25, 2024 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants