init
This commit is contained in:
19
app/api/kpi/[id]/progress/route.ts
Normal file
19
app/api/kpi/[id]/progress/route.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
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 })
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user