Function wicrs_server::api::rename_hub[][src]

pub async fn rename_hub<S: Into<String> + Clone>(
    user_id: &str,
    hub_id: ID,
    new_name: S
) -> Result<String>
Expand description

Changes the name of a hub.

Arguments

  • user_id - ID of the user to check for permission to perform the operation.
  • hub_id - The ID of the hub whose name is to be changed.
  • new_name - The new name to be given to the hub.

Errors

This function may return an error for any of the following reasons:

  • THe user is not in the hub.
  • The user does not have permission to rename the hub.
  • The given name failed to pass the checks for any of the reasons outlined in check_name_validity.
  • The hub could not be loaded for any of the reasons outlined by Hub::load.
  • The hub could not be saved for any of the reasons outlined by Hub::save.