main
UI Deploy (Next-Auth Support) 🎨 / build-and-deploy (push) Has been cancelled

This commit is contained in:
Harun CAN
2026-04-12 11:44:20 +02:00
parent 804f5b395e
commit 75de91848e
7 changed files with 571 additions and 4 deletions
+37
View File
@@ -248,6 +248,24 @@ export interface CreateFromTweetPayload {
targetDuration?: number;
}
export interface CreateFromYoutubePayload {
youtubeUrl: string;
title?: string;
language?: string;
aspectRatio?: string;
videoStyle?: string;
targetDuration?: number;
}
export interface CreateFromDocumentPayload {
file: File;
title?: string;
language?: string;
aspectRatio?: string;
videoStyle?: string;
targetDuration?: number;
}
export interface Notification {
id: string;
userId: string;
@@ -307,6 +325,25 @@ export const projectsApi = {
createFromTweet: (data: CreateFromTweetPayload) =>
apiClient.post<Project>('/projects/from-tweet', data).then((r) => r.data),
createFromYoutube: (data: CreateFromYoutubePayload) =>
apiClient.post<Project>('/projects/from-youtube', data).then((r) => r.data),
createFromDocument: (data: CreateFromDocumentPayload) => {
const formData = new FormData();
formData.append('file', data.file);
if (data.title) formData.append('title', data.title);
if (data.language) formData.append('language', data.language);
if (data.aspectRatio) formData.append('aspectRatio', data.aspectRatio);
if (data.videoStyle) formData.append('videoStyle', data.videoStyle);
if (data.targetDuration) formData.append('targetDuration', data.targetDuration.toString());
return apiClient.post<Project>('/projects/from-document', formData, {
headers: {
'Content-Type': 'multipart/form-data',
},
}).then((r) => r.data);
},
updateScene: (projectId: string, sceneId: string, data: Partial<Scene>) =>
apiClient.patch<Scene>(`/projects/${projectId}/scenes/${sceneId}`, data).then((r) => r.data),