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
@@ -184,6 +184,7 @@ const TimelineControls = ({
endTime: formatDetailedTime(segment.endTime),
name: segment.name,
chapterTitle: segment.chapterTitle,
text: segment.chapterTitle,
}));
logger.debug('segments', segments);
@@ -768,8 +768,9 @@ const useVideoChapters = () => {
// Convert chapters to backend expected format
const backendChapters = chapters.map((chapter) => ({
start: chapter.from,
title: chapter.name,
startTime: chapter.from,
endTime: chapter.to,
text: chapter.name,
}));
// Create the API request body
@@ -30,8 +30,7 @@ interface AutoSaveResponse {
// Auto-save API function
export const autoSaveVideo = async (mediaId: string, data: AutoSaveRequest): Promise<AutoSaveResponse> => {
try {
const response = await fetch(`/api/v1/media/${mediaId}/save_chapters`, {
// TODO: ask backend to add save_chapters endpoint
const response = await fetch(`/api/v1/media/${mediaId}/chapters`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
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