기능구현중

This commit is contained in:
2026-01-11 17:01:01 +09:00
parent 375d5bf91a
commit 954ba21211
148 changed files with 2276 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
import { execute } from '../../../utils/db'
import { requireAuth } from '../../../utils/session'
/**
* TODO 완료 처리
* PUT /api/todo/[id]/complete
*/
export default defineEventHandler(async (event) => {
await requireAuth(event)
const todoId = parseInt(event.context.params?.id || '0')
if (!todoId) {
throw createError({ statusCode: 400, message: 'TODO ID가 필요합니다.' })
}
await execute(`
UPDATE wr_todo
SET status = 'COMPLETED', completed_at = NOW(), updated_at = NOW()
WHERE todo_id = $1
`, [todoId])
return { success: true, message: '완료 처리되었습니다.' }
})