mirror of
https://github.com/mediacms-io/mediacms.git
synced 2025-11-06 15:38: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),
|
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);
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
@ -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
Loading…
x
Reference in New Issue
Block a user