Using upload file to hash and ban doesn't work as expected

(#593) Bug Fixed moderation self-hosting

Thread

Comment by @johnh-harris
RexSystem 1 vote originally by @johnh-harris on GitHub
I believe I found the issue with this, but I would like a maintainer to look at what I'm doing. So if we go into fluxer_admin/src/api/bans.rs we will see at line 232
    pub async fn ban_file_sha(
        &self,
        sha256_hex: &str,
        audit_log_reason: Option<&str>,
    ) -> ApiResult<()> {
        let body = generated_types::BanFileShaRequest {
            category: None,
            content_type: None,
            notes: None,
            severity: None,
            sha256_hex: sha256_hex.to_owned(),
            source_url: None,
        };
        self.post_typed_with_reason::<(), _>("/admin/bans/file-sha/add", &body, audit_log_reason)
            .await
    }
Looking at other examples we have direct calls to bans in whats generated Example with phrases
    pub async fn ban_phrase(&self, phrase: &str) -> ApiResult<()> {
        let body = generated_types::BanPhraseRequest {
            phrase: phrase.to_owned(),
        };
        self.generated()
            .add_phrase_ban(&body)
            .await
            .map_err(|e| self.generated_error(e))?;
        Ok(())
    }
I believe the approach to solving is just a simple call
    pub async fn ban_file_sha(
        &self,
        sha256_hex: &str,
        audit_log_reason: Option<&str>,
    ) -> ApiResult<()> {
        let body = generated_types::BanFileShaRequest {
            category: None,
            content_type: None,
            notes: None,
            severity: None,
            sha256_hex: sha256_hex.to_owned(),
            source_url: None,
        };
        self.generated()
            .add_file_sha_ban(&body)
            .await
            .map_err(|e| self.generated_error(e))?;
        Ok(())
    }