我拨打了具有多种方法的电话
class Post extends Something{
constructor(context, options) {
super(context, Options)
this.app.post('/', this.postEndpoint)
}
async postEndpoint (req, res) {
try {
const {DocStore} = req
const authCredentials = await this.getCredentials(DocStore)
// Code emitted intentionally
} catch (error) {
console.log(`error in postendpoint ${error}`)
}
async getCredentials (wipDocStore) {
console.log(`getting credentials`)
// Code emitted intentionally
}
}
请注意this.getCredentials(DocStore)
。当我运行代码时,它抛出一条错误消息
后端TypeError中的错误:无法读取属性'getCredentials' 的未定义
有人可以帮助我弄清楚我可能做错了什么吗?