【发布时间】:2021-01-14 22:42:04
【问题描述】:
我关注Slack's docs on authenticating with oAuth.
范围和令牌设置得很好。我正在努力设置installationStore.
这是我用来从 Firestore 数据库中获取数据的代码:
installationStore: {
fetchInstallation: async InstallQuery => {
// change the line below so it fetches from your database
// return await database.get(InstallQuery.teamId);
let cityRef = db.collection("teams").doc(InstallQuery.teamId);
let getDoc = cityRef
.get()
.then(doc => {
if (!doc.exists) {
console.log("No such document!");
} else {
console.log("Document data:", doc.data());
}
})
.catch(err => {
console.log("Error getting document", err);
});
return await getDoc;
}
}
我不确定我应该返回等待的是 getDoc,还是不是。有什么线索吗?
【问题讨论】:
标签: javascript google-cloud-firestore oauth slack-api