fix: restore brainstorming feature with missing socket server and real-time events
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import { NextRequest, NextResponse } from 'next/server'
|
||||
import prisma from '@/lib/prisma'
|
||||
import { auth } from '@/auth'
|
||||
import { logActivity } from '@/lib/brainstorm-collab'
|
||||
import { emitToSession } from '@/lib/socket-emit'
|
||||
|
||||
export async function POST(
|
||||
request: NextRequest,
|
||||
@@ -80,6 +82,15 @@ export async function POST(
|
||||
const dry = Array.from(noteImpactMap.values()).filter(n => n.acceptedCount === 0 && n.dismissedCount > 0).length
|
||||
const totalRefs = Array.from(noteImpactMap.values()).length
|
||||
|
||||
await logActivity(sessionId, 'session_finalized', session.user.id, { notesEnriched: fruitful, notesMarkedDry: dry })
|
||||
|
||||
await emitToSession(sessionId, 'activity:new', {
|
||||
action: 'session_finalized',
|
||||
userId: session.user.id,
|
||||
userName: session.user.name || 'Guest',
|
||||
details: { notesEnriched: fruitful, notesMarkedDry: dry }
|
||||
})
|
||||
|
||||
return NextResponse.json({
|
||||
success: true,
|
||||
impact: {
|
||||
|
||||
Reference in New Issue
Block a user