Skip to content

Commit

Permalink
refactor: [#615] added comments for new functions
Browse files Browse the repository at this point in the history
  • Loading branch information
mario-nt committed Aug 3, 2024
1 parent cd8f609 commit fe11c2f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/services/about.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ impl Service {
Service { authorization_service }
}

/// Returns the html with the about page
///
/// # Errors
///
/// It returns an error if:
///
/// * The user does not have the required permissions.
/// * There is an error authorizing the action.
pub async fn get_about_page(&self) -> Result<String, ServiceError> {
self.authorization_service.authorize(ACTION::GetAboutPage, None).await?;

Expand All @@ -39,6 +47,14 @@ impl Service {
Ok(html.to_string())
}

/// Returns the html with the license page
///
/// # Errors
///
/// It returns an error if:
///
/// * The user does not have the required permissions.
/// * There is an error authorizing the action.
pub async fn get_license_page(&self) -> Result<String, ServiceError> {
self.authorization_service.authorize(ACTION::GetLicensePage, None).await?;

Expand Down
8 changes: 8 additions & 0 deletions src/services/tag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,14 @@ impl Service {
}
}

/// Returns all the tags from the database
///
/// # Errors
///
/// It returns an error if:
///
/// * The user does not have the required permissions.
/// * There is a database error retrieving the tags.
pub async fn get_tags(&self) -> Result<Vec<TorrentTag>, ServiceError> {
self.authorization_service.authorize(ACTION::GetTags, None).await?;

Expand Down

0 comments on commit fe11c2f

Please sign in to comment.