-
Notifications
You must be signed in to change notification settings - Fork 12
Implement file uploads #722
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: launch/v1.0.0
Are you sure you want to change the base?
Conversation
… storage configuration for imprints. Includes Rust models and GraphQL types for File and FileUpload.
|
|
||
| #[cfg(feature = "backend")] | ||
| /// Parse a DOI into prefix and suffix | ||
| pub fn parse_doi(doi: &Doi) -> ThothResult<(String, String)> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Doi struct already performs validation, implementing FromStr (check thoth-api/src/model/mod.rs), and can output the string without the domain using to_string() (impl Display).
Overall, it'd make more sense to add a couple of methods to impl Doi in the model: fn prefix(&self) -> String and fn suffix(&self) -> String
| _filter_param_3: Option<Self::FilterParameter3>, | ||
| _filter_param_4: Option<Self::FilterParameter4>, | ||
| ) -> ThothResult<i32> { | ||
| Err(ThothError::InternalError( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just use unimplemented!()
| crate::model::publication::Publication::from_id(db, &publication_id)? | ||
| .publisher_id(db) | ||
| } | ||
| _ => Err(ThothError::InternalError( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've seen a bunch of ThothError::InternalError in the PR, but these are not internal errors but user input errors... So let's just create new variants for each of them in thoth-errors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume this can go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can make the whole module #[cfg(feature = "backend")] rather than each individual import/function
No description provided.