rename communityEcology → board across backend
Model, schemas, API routes, activity log, and all server handlers updated. Old ecology/ and community-ecology routes removed, new board/ routes added. Tests updated and new board-suggestions tests written (10 cases).
This commit is contained in:
parent
59d6e97787
commit
091ec58073
20 changed files with 405 additions and 80 deletions
|
|
@ -38,7 +38,7 @@ export default defineEventHandler(async (event) => {
|
|||
const andConditions = [];
|
||||
|
||||
if (peerSupport === "true") {
|
||||
dbQuery["communityEcology.offerPeerSupport"] = true;
|
||||
dbQuery["board.offerPeerSupport"] = true;
|
||||
}
|
||||
|
||||
if (search) {
|
||||
|
|
@ -56,7 +56,7 @@ export default defineEventHandler(async (event) => {
|
|||
}
|
||||
|
||||
if (connectionTag) {
|
||||
dbQuery["communityEcology.topics.tagSlug"] = connectionTag;
|
||||
dbQuery["board.topics.tagSlug"] = connectionTag;
|
||||
}
|
||||
|
||||
if (andConditions.length > 0) {
|
||||
|
|
@ -66,7 +66,7 @@ export default defineEventHandler(async (event) => {
|
|||
try {
|
||||
const members = await Member.find(dbQuery)
|
||||
.select(
|
||||
"name pronouns timeZone avatar studio bio location socialLinks privacy circle craftTags communityEcology createdAt",
|
||||
"name pronouns timeZone avatar studio bio location socialLinks privacy circle craftTags board createdAt",
|
||||
)
|
||||
.sort({ createdAt: -1 })
|
||||
.lean();
|
||||
|
|
@ -96,14 +96,14 @@ export default defineEventHandler(async (event) => {
|
|||
if (isVisible("socialLinks")) filtered.socialLinks = member.socialLinks;
|
||||
if (isVisible("craftTags")) filtered.craftTags = member.craftTags;
|
||||
|
||||
if (isVisible("communityEcology")) {
|
||||
const ecology = member.communityEcology || {};
|
||||
filtered.communityEcology = {
|
||||
topics: ecology.topics,
|
||||
offerPeerSupport: ecology.offerPeerSupport,
|
||||
availability: ecology.availability,
|
||||
...(ecology.offerPeerSupport && {
|
||||
slackHandle: ecology.slackHandle,
|
||||
if (isVisible("board")) {
|
||||
const board = member.board || {};
|
||||
filtered.board = {
|
||||
topics: board.topics,
|
||||
offerPeerSupport: board.offerPeerSupport,
|
||||
availability: board.availability,
|
||||
...(board.offerPeerSupport && {
|
||||
slackHandle: board.slackHandle,
|
||||
}),
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue