refactor(board): delete old board routes, absorb slackHandle into profile PATCH
- Delete server/api/members/me/board.patch.js and server/api/board/suggestions.get.js - Add boardSlackHandle to memberProfileUpdateSchema; remove boardPrivacy - profile.patch.js: write boardSlackHandle -> board.slackHandle; drop boardPrivacy - Remove privacy.board field from Member model - onboarding/status.get.js: hasProfileTags now requires only craftTags; hasEngagedBoard uses BoardPost.exists - onboarding/track.post.js: graduation check uses BoardPost.exists instead of board.topics elemMatch - members/[id].get.js and directory.get.js: reduce board response to slackHandle only; drop connectionTag and peerSupport filters
This commit is contained in:
parent
6a440a846d
commit
1fc937a26a
9 changed files with 34 additions and 230 deletions
|
|
@ -1,18 +1,16 @@
|
|||
import { requireAuth } from '../../utils/auth.js'
|
||||
import BoardPost from '../../models/boardPost.js'
|
||||
|
||||
export default defineEventHandler(async (event) => {
|
||||
const member = await requireAuth(event)
|
||||
|
||||
const hasProfileTags =
|
||||
member.craftTags.length > 0 &&
|
||||
(member.board?.topics || []).length > 0
|
||||
const hasProfileTags = member.craftTags.length > 0
|
||||
|
||||
const hasVisitedEvent = !!member.onboarding?.eventPageVisited
|
||||
|
||||
const topics = member.board?.topics || []
|
||||
const hasPosted = await BoardPost.exists({ author: member._id })
|
||||
const hasEngagedBoard =
|
||||
!!member.onboarding?.boardPageVisited &&
|
||||
topics.some((t) => ['help', 'interested', 'seeking'].includes(t.state))
|
||||
!!member.onboarding?.boardPageVisited && !!hasPosted
|
||||
|
||||
const hasClickedWiki = !!member.onboarding?.wikiClicked
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue