작업계획서대로 진행

This commit is contained in:
2026-01-11 10:50:51 +09:00
parent 5cda181cc5
commit d4620dc1fa
39 changed files with 3344 additions and 120 deletions

View File

@@ -0,0 +1,23 @@
import { execute, queryOne } from '../../../utils/db'
import { getCurrentUserId } from '../../../utils/user'
/**
* VCS 계정 삭제
* DELETE /api/vcs-account/[id]/delete
*/
export default defineEventHandler(async (event) => {
const accountId = Number(getRouterParam(event, 'id'))
const userId = await getCurrentUserId(event)
const existing = await queryOne(
'SELECT * FROM wr_employee_vcs_account WHERE account_id = $1 AND employee_id = $2',
[accountId, userId]
)
if (!existing) {
throw createError({ statusCode: 404, message: 'VCS 계정을 찾을 수 없습니다.' })
}
await execute('DELETE FROM wr_employee_vcs_account WHERE account_id = $1', [accountId])
return { success: true, message: 'VCS 계정이 삭제되었습니다.' }
})