generated from fahricansecer/boilerplate-fe
This commit is contained in:
@@ -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),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user