기능구현중
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { requireAuth } from '../../../../utils/session'
|
||||
import { syncProjectGitRepositories } from '../../../../utils/git-sync'
|
||||
import { syncProjectSvnRepositories } from '../../../../utils/svn-sync'
|
||||
|
||||
/**
|
||||
* 프로젝트 커밋 새로고침 (모든 저장소 동기화)
|
||||
@@ -13,13 +14,18 @@ export default defineEventHandler(async (event) => {
|
||||
throw createError({ statusCode: 400, message: '프로젝트 ID가 필요합니다.' })
|
||||
}
|
||||
|
||||
const result = await syncProjectGitRepositories(projectId)
|
||||
// Git과 SVN 모두 동기화
|
||||
const gitResult = await syncProjectGitRepositories(projectId)
|
||||
const svnResult = await syncProjectSvnRepositories(projectId)
|
||||
|
||||
const allResults = [...gitResult.results, ...svnResult.results]
|
||||
const allSuccess = allResults.every(r => r.success)
|
||||
|
||||
return {
|
||||
success: result.success,
|
||||
message: result.success
|
||||
? `${result.results.length}개 저장소 동기화 완료`
|
||||
success: allSuccess,
|
||||
message: allSuccess
|
||||
? `${allResults.length}개 저장소 동기화 완료`
|
||||
: '일부 저장소 동기화 실패',
|
||||
results: result.results
|
||||
results: allResults
|
||||
}
|
||||
})
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { queryOne } from '../../../utils/db'
|
||||
import { requireAuth } from '../../../utils/session'
|
||||
import { syncGitRepository } from '../../../utils/git-sync'
|
||||
import { syncSvnRepository } from '../../../utils/svn-sync'
|
||||
|
||||
/**
|
||||
* 저장소 동기화 (수동)
|
||||
@@ -30,8 +31,8 @@ export default defineEventHandler(async (event) => {
|
||||
const result = await syncGitRepository(repoId)
|
||||
return result
|
||||
} else if (repo.server_type === 'SVN') {
|
||||
// SVN은 별도 구현 예정
|
||||
return { success: false, message: 'SVN 동기화는 준비 중입니다.' }
|
||||
const result = await syncSvnRepository(repoId)
|
||||
return result
|
||||
}
|
||||
|
||||
return { success: false, message: '지원하지 않는 서버 타입입니다.' }
|
||||
|
||||
Reference in New Issue
Block a user