修复动态发布与互动问题
This commit is contained in:
@@ -16,13 +16,12 @@ async function safeCount(collection, where) {
|
||||
// Derive live stats from the source collections so the displayed numbers are
|
||||
// always accurate instead of relying on a stored field that can drift.
|
||||
async function computeStats(user) {
|
||||
const [posts, favorites, following, followers] = await Promise.all([
|
||||
const [posts, following, followers] = await Promise.all([
|
||||
safeCount('posts', { authorId: user._id }),
|
||||
safeCount('postFavorites', { openid: user.openid }),
|
||||
safeCount('follows', { followerId: user._id }),
|
||||
safeCount('follows', { followeeId: user._id })
|
||||
])
|
||||
return { posts, following, followers, favorites }
|
||||
return { posts, following, followers }
|
||||
}
|
||||
|
||||
exports.main = async event => {
|
||||
|
||||
Reference in New Issue
Block a user