@@ -5,9 +5,12 @@ use serde::{Deserialize, Serialize};
55use serde_json:: json;
66use tauri:: AppHandle ;
77
8- use crate :: web_api:: ManagerExt ;
8+ use crate :: web_api:: { AuthedApiError , ManagerExt } ;
99
10- pub async fn upload_multipart_initiate ( app : & AppHandle , video_id : & str ) -> Result < String , String > {
10+ pub async fn upload_multipart_initiate (
11+ app : & AppHandle ,
12+ video_id : & str ,
13+ ) -> Result < String , AuthedApiError > {
1114 #[ derive( Deserialize ) ]
1215 #[ serde( rename_all = "camelCase" ) ]
1316 pub struct Response {
@@ -49,7 +52,7 @@ pub async fn upload_multipart_presign_part(
4952 upload_id : & str ,
5053 part_number : u32 ,
5154 md5_sum : & str ,
52- ) -> Result < String , String > {
55+ ) -> Result < String , AuthedApiError > {
5356 #[ derive( Deserialize ) ]
5457 #[ serde( rename_all = "camelCase" ) ]
5558 pub struct Response {
@@ -114,7 +117,7 @@ pub async fn upload_multipart_complete(
114117 upload_id : & str ,
115118 parts : & [ UploadedPart ] ,
116119 meta : Option < S3VideoMeta > ,
117- ) -> Result < Option < String > , String > {
120+ ) -> Result < Option < String > , AuthedApiError > {
118121 #[ derive( Serialize ) ]
119122 #[ serde( rename_all = "camelCase" ) ]
120123 pub struct MultipartCompleteRequest < ' a > {
@@ -179,7 +182,10 @@ pub struct PresignedS3PutRequest {
179182 pub meta : Option < S3VideoMeta > ,
180183}
181184
182- pub async fn upload_signed ( app : & AppHandle , body : PresignedS3PutRequest ) -> Result < String , String > {
185+ pub async fn upload_signed (
186+ app : & AppHandle ,
187+ body : PresignedS3PutRequest ,
188+ ) -> Result < String , AuthedApiError > {
183189 #[ derive( Deserialize ) ]
184190 struct Data {
185191 url : String ,
@@ -218,7 +224,7 @@ pub async fn desktop_video_progress(
218224 video_id : & str ,
219225 uploaded : u64 ,
220226 total : u64 ,
221- ) -> Result < ( ) , String > {
227+ ) -> Result < ( ) , AuthedApiError > {
222228 let resp = app
223229 . authed_api_request ( "/api/desktop/video/progress" , |client, url| {
224230 client. post ( url) . json ( & json ! ( {
0 commit comments