기능구현중
This commit is contained in:
22
backend/api/repository/[id]/index.delete.ts
Normal file
22
backend/api/repository/[id]/index.delete.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { execute } from '../../../utils/db'
|
||||
import { requireAuth } from '../../../utils/session'
|
||||
|
||||
/**
|
||||
* 저장소 삭제 (비활성화)
|
||||
* DELETE /api/repository/[id]
|
||||
*/
|
||||
export default defineEventHandler(async (event) => {
|
||||
await requireAuth(event)
|
||||
const repoId = parseInt(event.context.params?.id || '0')
|
||||
|
||||
if (!repoId) {
|
||||
throw createError({ statusCode: 400, message: '저장소 ID가 필요합니다.' })
|
||||
}
|
||||
|
||||
// 실제 삭제 대신 비활성화
|
||||
await execute(`
|
||||
UPDATE wr_repository SET is_active = false, updated_at = NOW() WHERE repo_id = $1
|
||||
`, [repoId])
|
||||
|
||||
return { success: true }
|
||||
})
|
||||
Reference in New Issue
Block a user