기능구현중
This commit is contained in:
25
backend/api/project/[id]/commits/refresh.post.ts
Normal file
25
backend/api/project/[id]/commits/refresh.post.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { requireAuth } from '../../../../utils/session'
|
||||
import { syncProjectGitRepositories } from '../../../../utils/git-sync'
|
||||
|
||||
/**
|
||||
* 프로젝트 커밋 새로고침 (모든 저장소 동기화)
|
||||
* POST /api/project/[id]/commits/refresh
|
||||
*/
|
||||
export default defineEventHandler(async (event) => {
|
||||
await requireAuth(event)
|
||||
const projectId = parseInt(getRouterParam(event, 'id') || '0')
|
||||
|
||||
if (!projectId) {
|
||||
throw createError({ statusCode: 400, message: '프로젝트 ID가 필요합니다.' })
|
||||
}
|
||||
|
||||
const result = await syncProjectGitRepositories(projectId)
|
||||
|
||||
return {
|
||||
success: result.success,
|
||||
message: result.success
|
||||
? `${result.results.length}개 저장소 동기화 완료`
|
||||
: '일부 저장소 동기화 실패',
|
||||
results: result.results
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user