mirror of
https://github.com/mediacms-io/mediacms.git
synced 2025-11-06 07:28:53 -05:00
fix: Change endpoint save_chapters to chapters [POST]
This commit is contained in:
parent
0dda684c3f
commit
6eab5bf7b7
@ -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
Loading…
x
Reference in New Issue
Block a user