blue-battery-71202
08/23/2022, 11:03 AMAPI.getAccessCodes(id).then((response: **GetCodesResponse**) => { // error 1
expect(response.success).to.be.true; // intellisense work here as expected
expect(response.data.code).to.equal('12345678'); // intellisense work here
});
// error 1:
// No overload matches this call. Argument of type '(response: GetCodesResponse) => void' is not assignable to parameter of type '(this: ObjectLike, currentSubject: Response<any>) => void'.
// API.getAccessCodes(id: string): Cypress.Chainable<Cypress.Response<any>>
getAccessCodes return the cy.request(), and the above example works as expected, however I cannot seem to resolve the issue with the response type, and if I do, TS loses the ability to have intellisense inside the .then()