feat: add community-connections API endpoint and update profile handler

New PATCH /api/members/me/community-connections endpoint following peer-support.patch.js pattern (requireAuth, validateBody, dot-notation $set, Slack user lookup when offerPeerSupport+slackHandle set, logActivity).

Profile endpoint updated with craftTags handling, craftTagsPrivacy and communityConnectionsPrivacy in privacy fields, and craftTags in response.
This commit is contained in:
Jennie Robinson Faber 2026-04-05 16:19:49 +01:00
parent 06ee77592f
commit 3faa1f8e85
2 changed files with 103 additions and 0 deletions

View file

@ -33,6 +33,8 @@ export default defineEventHandler(async (event) => {
"socialLinksPrivacy",
"offeringPrivacy",
"lookingForPrivacy",
"craftTagsPrivacy",
"communityConnectionsPrivacy",
];
// Build update object from validated data
@ -44,6 +46,11 @@ export default defineEventHandler(async (event) => {
}
});
// Handle craftTags (simple array)
if (body.craftTags !== undefined) {
updateData.craftTags = body.craftTags;
}
// Handle offering and lookingFor separately (nested objects)
if (body.offering !== undefined) {
updateData.offering = {
@ -102,6 +109,7 @@ export default defineEventHandler(async (event) => {
socialLinks: member.socialLinks,
offering: member.offering,
lookingFor: member.lookingFor,
craftTags: member.craftTags,
showInDirectory: member.showInDirectory,
notifications: member.notifications,
};