feat: add uploader
This commit is contained in:
@@ -84,6 +84,16 @@ pub async fn delete_files(
|
||||
Ok(Json(json!({ "deleted": deleted })))
|
||||
}
|
||||
|
||||
pub async fn list_my_files(
|
||||
State(state): State<Arc<AppState>>,
|
||||
auth: AuthUser,
|
||||
) -> Result<Json<FilesMetaResponse>, AppError> {
|
||||
let files = storage::list_user_files(&state.config.data_dir, &auth.username)
|
||||
.await
|
||||
.map_err(AppError::Io)?;
|
||||
Ok(Json(FilesMetaResponse { files }))
|
||||
}
|
||||
|
||||
pub async fn upload_file(
|
||||
State(state): State<Arc<AppState>>,
|
||||
auth: AuthUser,
|
||||
|
||||
Reference in New Issue
Block a user