fix: Change endpoint save_chapters to chapters [POST]

This commit is contained in:
Yiannis Christodoulou 2025-09-16 09:55:15 +03:00
parent 0dda684c3f
commit 6eab5bf7b7
5 changed files with 26 additions and 25 deletions

View File

@ -184,6 +184,7 @@ const TimelineControls = ({
endTime: formatDetailedTime(segment.endTime), endTime: formatDetailedTime(segment.endTime),
name: segment.name, name: segment.name,
chapterTitle: segment.chapterTitle, chapterTitle: segment.chapterTitle,
text: segment.chapterTitle,
})); }));
logger.debug('segments', segments); logger.debug('segments', segments);

View File

@ -768,8 +768,9 @@ const useVideoChapters = () => {
// Convert chapters to backend expected format // Convert chapters to backend expected format
const backendChapters = chapters.map((chapter) => ({ const backendChapters = chapters.map((chapter) => ({
start: chapter.from, startTime: chapter.from,
title: chapter.name, endTime: chapter.to,
text: chapter.name,
})); }));
// Create the API request body // Create the API request body

View File

@ -30,8 +30,7 @@ interface AutoSaveResponse {
// Auto-save API function // Auto-save API function
export const autoSaveVideo = async (mediaId: string, data: AutoSaveRequest): Promise<AutoSaveResponse> => { export const autoSaveVideo = async (mediaId: string, data: AutoSaveRequest): Promise<AutoSaveResponse> => {
try { try {
const response = await fetch(`/api/v1/media/${mediaId}/save_chapters`, { const response = await fetch(`/api/v1/media/${mediaId}/chapters`, {
// TODO: ask backend to add save_chapters endpoint
method: 'POST', method: 'POST',
headers: { 'Content-Type': 'application/json' }, headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(data), body: JSON.stringify(data),

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long