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

To directly access the Data property from an API response #838

Open
sonce opened this issue Jul 19, 2024 · 1 comment
Open

To directly access the Data property from an API response #838

sonce opened this issue Jul 19, 2024 · 1 comment

Comments

@sonce
Copy link

sonce commented Jul 19, 2024

Hi,I want To directly access the "Data"property from an API response where the response is structured as:

{
  "status": 0,
  "code": 0,
  "errorMsg": "aaa",
  "Data": {}
}

Before :

        const result= await api.order.freightSeachFreightPageList()
        expect(result.data.Data.Rows.length > 0, "xxxxxxxxx").toBeTruthy();

Expected:

        const result= await api.order.freightSeachFreightPageList()
        expect(result.Rows.length > 0, "xxxxxxxxx").toBeTruthy();

thx.

@wolf266662
Copy link

--unwrap-response-data

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants