Skip to content

I believe "included" responses are not Typed correctly #172

@benhowdle89

Description

@benhowdle89
get(id: string, include?: string): Promise<UnitResponse<Payment & Include<Account[] | Customer[] | Transaction[]>>>;

the actual response is as such:

data: {},
included: {}

which is as expected as per the API docs, but the TS type is wrong, so you get the following error:

Property 'included' does not exist on type 'UnitResponse<Payment & Include<Account[] | Customer[] | Transaction[]>>'.

When accessing like so:

const payment = await unit.getPayment(paymentId);
const { data, included } = payment;

I might be wrong, but I think it should be: Promise<UnitResponse<Payment> & Include<Account[] | Customer[] | Transaction[]>>

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