Library Version: 44.2.0
const cards = await client.cards.list({
customerId: squareCustomerId,
});
Response
Body: {
"errors": [
{
"category": "INVALID_REQUEST_ERROR",
"code": "INVALID_ENUM_VALUE",
"detail": "`` is not a valid enum value for `sort_order`.",
"field": "sort_order"
}
]
}
"rawResponse":{"headers":{},"redirected":false,"status":400,"statusText":"Bad Request","type":"basic","url":"https://connect.squareupsandbox.com/v2/cards?customer_id=<redacted>&sort_order="},
Expected behaviour
Not passing sortOrder should just return the default, presumably by just removing the &sort_order= query from the url when not provided.
Workaround
const cards = await client.cards.list({
customerId: squareCustomerId,
sortOrder: 'DESC',
});
Library Version:
44.2.0Response
Expected behaviour
Not passing
sortOrdershould just return the default, presumably by just removing the&sort_order=query from the url when not provided.Workaround