From 1569ead56cd746810427f27cb8adae6cd97f7efa Mon Sep 17 00:00:00 2001 From: hbyang Date: Thu, 26 Feb 2026 14:13:32 +0900 Subject: [PATCH] =?UTF-8?q?video=5Fid=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/Dashboard/CompletionContent.tsx | 9 +++++++-- src/types/api.ts | 1 + src/utils/api.ts | 11 +++++++++++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/pages/Dashboard/CompletionContent.tsx b/src/pages/Dashboard/CompletionContent.tsx index 73fa7c3..a837980 100755 --- a/src/pages/Dashboard/CompletionContent.tsx +++ b/src/pages/Dashboard/CompletionContent.tsx @@ -45,6 +45,7 @@ const CompletionContent: React.FC = ({ // 소셜 미디어 포스팅 모달 const [showSocialModal, setShowSocialModal] = useState(false); + const [videoDbId, setVideoDbId] = useState(null); // 저장된 완료 데이터 const [songCompletionData, setSongCompletionData] = useState<{ @@ -203,6 +204,10 @@ const CompletionContent: React.FC = ({ if (videoUrlFromResponse) { setVideoUrl(videoUrlFromResponse); + const videoId = statusResponse.render_data?.video_id; + if (videoId) { + setVideoDbId(videoId); + } setVideoStatus('complete'); setStatusMessage(''); saveToStorage(videoTaskId, currentSongTaskId, 'complete', videoUrlFromResponse); @@ -515,8 +520,8 @@ const CompletionContent: React.FC = ({ ; error_message: string | null; diff --git a/src/utils/api.ts b/src/utils/api.ts index 3062b4a..cf85190 100644 --- a/src/utils/api.ts +++ b/src/utils/api.ts @@ -301,6 +301,17 @@ export async function getVideosList(page: number = 1, pageSize: number = 10): Pr return response.json(); } +// task_id로 video_id 조회 (소셜 업로드용) +export async function getVideoIdByTaskId(taskId: string): Promise { + try { + const response = await getVideosList(1, 50); + const found = response.items.find(v => v.task_id === taskId); + return found?.video_id ?? null; + } catch { + return null; + } +} + // 비디오 삭제 API (개별 비디오 삭제) export async function deleteVideo(videoId: number): Promise { const response = await authenticatedFetch(`${API_URL}/archive/videos/${videoId}`, {