Files
ExecuBoard/app/api/kpi/[id]/progress/route.ts
2025-08-01 00:55:05 +08:00

19 lines
638 B
TypeScript

import { NextRequest, NextResponse } from 'next/server'
import { kpiService } from '@/lib/database'
// POST - 更新 KPI 進度
export async function POST(
request: NextRequest,
{ params }: { params: { id: string } }
) {
try {
const body = await request.json()
const { progress, comment, blockers, userId } = body
await kpiService.updateKPIProgress(params.id, progress, comment, blockers, userId)
return NextResponse.json({ message: '進度更新成功' })
} catch (error) {
console.error('更新進度失敗:', error)
return NextResponse.json({ error: '更新進度失敗' }, { status: 500 })
}
}