|
@@ -1,6 +1,6 @@
|
|
|
import axios from "axios";
|
|
|
import { apiUrl } from "@/env";
|
|
|
-import type { IUserProfile, IUserProfileUpdate, IUserProfileCreate, Video} from "@/interfaces";
|
|
|
+import type { IUserProfile, IUserProfileUpdate, IUserProfileCreate, Video, VideoCreate} from "@/interfaces";
|
|
|
|
|
|
function authHeaders(token: string) {
|
|
|
return {
|
|
@@ -57,9 +57,11 @@ export const api = {
|
|
|
formData.append("file", file)
|
|
|
return axios.post<{msg:string}>(`${apiUrl}/api/v1/utils/test-celery/file`, formData, authHeaders(token));
|
|
|
},
|
|
|
- async uploadPlot(token: string, title:string, file: File){
|
|
|
+ async uploadPlot(token: string, video_data:VideoCreate, file: File){
|
|
|
const formData = new FormData();
|
|
|
- formData.append("title", title)
|
|
|
+ formData.append("title", video_data.title)
|
|
|
+ formData.append("anchor_id", video_data.anchor_id.toString())
|
|
|
+ formData.append("lang_id", video_data.lang_id.toString())
|
|
|
formData.append("upload_file", file)
|
|
|
return axios.post<{msg:string}>(`${apiUrl}/api/v1/videos/`, formData, authHeaders(token));
|
|
|
},
|