there are two classes ( I created new instance from first class in main class )
TypeError: Cannot read property 'first1' of undefined
export default class main {
first1: first
constructor() {
this.first1 = new first()
}
async list(req: Request, res: Response, next: NextFunction) {
try {
const { result } = await this.first1.list({ limit: req.query.limit, page:
req.query.page, filters: req.query.filters })
res.status(200).json(result)
} catch (error) {
console.log(error)
CatchError(error, next)
}
}
}
export default class first{
async list({ limit, page, filters }) {
let result: {data:"ssssssss"}
return { result }
}
}