refactor(peer-support): delete provably dead code (Phase 1)
The Skills Exchange + Peer Support feature was replaced by Community
Connections on 2026-04-05, but several files and code paths were left
in place as backward-compat. None are reachable from the live UI:
- usePeerSupport.js composable: not imported anywhere
- PeerSupportBadge.vue: not imported anywhere
- peer-support.vue: stub redirect with no incoming links
- /api/peer-support.get.js: only consumed by usePeerSupport
- /api/members/me/peer-support.patch.js: same
- profile.patch.js offering/lookingFor write branches: profile form
no longer sends these fields (only writes communityConnections.*)
- PEER_SUPPORT_ENABLED/DISABLED activity types and renderers: only
written by the deleted peer-support.patch endpoint. The activityText
formatter has a fallback for unknown types so existing records
still display ("peer support enabled" with a generic icon).
Tests updated to drop peerSupportUpdateSchema coverage and the
offering/lookingFor passthrough assertion.
schemas.js cleanup deferred — concurrent communityConnections →
communityEcology rename is in flight in the working tree.
This commit is contained in:
parent
130e5bfa9f
commit
9577929e0d
11 changed files with 0 additions and 366 deletions
|
|
@ -27,8 +27,6 @@ describe('members profile PATCH endpoint', () => {
|
|||
bio: 'Updated bio',
|
||||
location: 'NYC',
|
||||
socialLinks: { twitter: '@test' },
|
||||
offering: { text: 'help', tags: ['code'] },
|
||||
lookingFor: { text: 'feedback', tags: ['design'] },
|
||||
showInDirectory: true
|
||||
}
|
||||
|
||||
|
|
@ -137,21 +135,5 @@ describe('members profile PATCH endpoint', () => {
|
|||
expect(setData).toHaveProperty('socialLinks')
|
||||
})
|
||||
|
||||
it('passes offering and lookingFor nested objects through', async () => {
|
||||
const event = createMockEvent({
|
||||
method: 'PATCH',
|
||||
path: '/api/members/profile',
|
||||
body: {
|
||||
offering: { text: 'mentoring', tags: ['code', 'design'] },
|
||||
lookingFor: { text: 'feedback', tags: ['art'] }
|
||||
}
|
||||
})
|
||||
|
||||
await profilePatchHandler(event)
|
||||
|
||||
const setData = Member.findByIdAndUpdate.mock.calls[0][1].$set
|
||||
expect(setData.offering).toEqual({ text: 'mentoring', tags: ['code', 'design'] })
|
||||
expect(setData.lookingFor).toEqual({ text: 'feedback', tags: ['art'] })
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ import {
|
|||
guestRegisterSchema,
|
||||
eventPaymentSchema,
|
||||
updateContributionSchema,
|
||||
peerSupportUpdateSchema,
|
||||
seriesTicketPurchaseSchema,
|
||||
seriesTicketEligibilitySchema,
|
||||
adminSeriesCreateSchema,
|
||||
|
|
@ -305,29 +304,6 @@ describe('updateContributionSchema', () => {
|
|||
})
|
||||
})
|
||||
|
||||
describe('peerSupportUpdateSchema', () => {
|
||||
it('accepts valid peer support data', () => {
|
||||
const result = peerSupportUpdateSchema.safeParse({
|
||||
enabled: true,
|
||||
skillTopics: ['game design', 'business'],
|
||||
slackUsername: 'jane'
|
||||
})
|
||||
expect(result.success).toBe(true)
|
||||
})
|
||||
|
||||
it('accepts empty object', () => {
|
||||
const result = peerSupportUpdateSchema.safeParse({})
|
||||
expect(result.success).toBe(true)
|
||||
})
|
||||
|
||||
it('rejects non-array skillTopics', () => {
|
||||
const result = peerSupportUpdateSchema.safeParse({
|
||||
skillTopics: 'not-an-array'
|
||||
})
|
||||
expect(result.success).toBe(false)
|
||||
})
|
||||
})
|
||||
|
||||
// --- Series schemas ---
|
||||
|
||||
describe('seriesTicketPurchaseSchema', () => {
|
||||
|
|
@ -505,7 +481,6 @@ describe('validateBody migration coverage', () => {
|
|||
'events/[id]/guest-register.post.js',
|
||||
'events/[id]/payment.post.js',
|
||||
'members/update-contribution.post.js',
|
||||
'members/me/peer-support.patch.js',
|
||||
'series/[id]/tickets/purchase.post.js',
|
||||
'series/[id]/tickets/check-eligibility.post.js',
|
||||
'admin/series.post.js',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue