From 1728141517ceb213b925e9669e262781f1b60e4c Mon Sep 17 00:00:00 2001 From: Elijah Voigt Date: Sun, 8 Mar 2026 20:43:48 -0700 Subject: [PATCH] fix(quotesdb): add PartialEq to report types, remove unused import - Derive PartialEq on ReportSummary, ReportListResponse, ReportRow, and QuoteReports so they can be held in Yew state enums that require PartialEq - Remove unused ApiError import from moderation_tab.rs Co-Authored-By: Claude Sonnet 4.6 --- quotesdb/src/bin/ui/api.rs | 8 ++++---- quotesdb/src/bin/ui/components/moderation_tab.rs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/quotesdb/src/bin/ui/api.rs b/quotesdb/src/bin/ui/api.rs index 2a076e0..9151c04 100644 --- a/quotesdb/src/bin/ui/api.rs +++ b/quotesdb/src/bin/ui/api.rs @@ -391,7 +391,7 @@ pub async fn report_quote( /// Summary of a reported quote in the admin reports list. /// /// Returned by `GET /api/admin/reports`. -#[derive(Debug, Clone, Deserialize)] +#[derive(Debug, Clone, Deserialize, PartialEq)] pub struct ReportSummary { /// The ID of the reported quote. pub quote_id: String, @@ -408,7 +408,7 @@ pub struct ReportSummary { /// Paginated list of reported quotes. /// /// Returned by `GET /api/admin/reports?page=N`. -#[derive(Debug, Clone, Deserialize)] +#[derive(Debug, Clone, Deserialize, PartialEq)] pub struct ReportListResponse { /// Summaries of reported quotes on this page. pub reports: Vec, @@ -419,7 +419,7 @@ pub struct ReportListResponse { } /// A single report row within a quote's report detail. -#[derive(Debug, Clone, Deserialize)] +#[derive(Debug, Clone, Deserialize, PartialEq)] pub struct ReportRow { /// Unique report ID. pub id: String, @@ -432,7 +432,7 @@ pub struct ReportRow { /// Full details for a reported quote: the quote plus all individual reports. /// /// Returned by `GET /api/admin/reports/:quote_id`. -#[derive(Debug, Clone, Deserialize)] +#[derive(Debug, Clone, Deserialize, PartialEq)] pub struct QuoteReports { /// The full quote object. pub quote: quotesdb::Quote, diff --git a/quotesdb/src/bin/ui/components/moderation_tab.rs b/quotesdb/src/bin/ui/components/moderation_tab.rs index b1b2781..64c048d 100644 --- a/quotesdb/src/bin/ui/components/moderation_tab.rs +++ b/quotesdb/src/bin/ui/components/moderation_tab.rs @@ -11,7 +11,7 @@ //! } //! ``` -use crate::api::{self, ApiError, QuoteReports, ReportListResponse, ReportSummary}; +use crate::api::{self, QuoteReports, ReportListResponse, ReportSummary}; use crate::components::pagination::Pagination; use wasm_bindgen_futures::spawn_local; use yew::prelude::*;