mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
feat: initial file upload api (#4299)
* feat: initial file upload api * feat: initial file upload api * fix: add pb index * feat: remove file name * feat: read everything to mem * feat: revamp object storage * chore: cargo format * chore: update deps * feat: revised implementations and style * chore: use deploy env instead * chore: use deploy env instead * chore: use deploy env instead * refactor: move logic to handler to manager * fix: format issues * fix: cargo clippy * chore: cargo check tauri * fix: debug docker integration test * fix: debug docker integration test * fix: debug docker integration test gotrue * fix: debug docker integration test docker compose version * fix: docker scripts * fix: cargo fmt * fix: add sleep after docker compose up --------- Co-authored-by: nathan <nathan@appflowy.io>
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
use std::path::Path;
|
||||
use validator::ValidationError;
|
||||
|
||||
pub fn required_not_empty_str(s: &str) -> Result<(), ValidationError> {
|
||||
@ -6,3 +7,11 @@ pub fn required_not_empty_str(s: &str) -> Result<(), ValidationError> {
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn required_valid_path(s: &str) -> Result<(), ValidationError> {
|
||||
let path = Path::new(s);
|
||||
match (path.is_absolute(), path.exists()) {
|
||||
(true, true) => Ok(()),
|
||||
(_, _) => Err(ValidationError::new("invalid_path")),
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user