fix: rename hasEngagedEcology → hasEngagedBoard in onboarding status, clean up stale ecology references

This commit is contained in:
Jennie Robinson Faber 2026-04-14 12:25:24 +01:00
parent 74b2287d48
commit a0f60bcdc0
8 changed files with 24 additions and 24 deletions

View file

@ -5,10 +5,10 @@ import { requireAuth } from '../../utils/auth.js'
export default defineEventHandler(async (event) => {
const member = await requireAuth(event)
// Combine craft tags and cooperative ecology tags
// Combine craft tags and board topic tags
const craftTags = member.craftTags || []
const ecologyTags = (member.board?.topics || []).map(t => t.tagSlug)
const memberTags = [...new Set([...craftTags, ...ecologyTags].filter(Boolean))]
const boardTags = (member.board?.topics || []).map(t => t.tagSlug)
const memberTags = [...new Set([...craftTags, ...boardTags].filter(Boolean))]
if (!memberTags.length) {
return []

View file

@ -10,7 +10,7 @@ export default defineEventHandler(async (event) => {
const hasVisitedEvent = !!member.onboarding?.eventPageVisited
const topics = member.board?.topics || []
const hasEngagedEcology =
const hasEngagedBoard =
!!member.onboarding?.boardPageVisited &&
topics.some((t) => ['help', 'interested', 'seeking'].includes(t.state))
@ -20,7 +20,7 @@ export default defineEventHandler(async (event) => {
goals: {
hasProfileTags,
hasVisitedEvent,
hasEngagedEcology,
hasEngagedBoard,
hasClickedWiki,
},
completedAt: member.onboarding?.completedAt || null,

View file

@ -5,10 +5,10 @@ import { requireAuth } from '../../utils/auth.js'
export default defineEventHandler(async (event) => {
const member = await requireAuth(event)
// Combine craft tags and cooperative ecology tags
// Combine craft tags and board topic tags
const craftTags = member.craftTags || []
const ecologyTags = (member.board?.topics || []).map(t => t.tagSlug)
const memberTags = [...new Set([...craftTags, ...ecologyTags].filter(Boolean))]
const boardTags = (member.board?.topics || []).map(t => t.tagSlug)
const memberTags = [...new Set([...craftTags, ...boardTags].filter(Boolean))]
if (!memberTags.length) {
return []