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 <noreply@anthropic.com>
quotesdb
Elijah Voigt 3 months ago
parent 5dadc23246
commit 1728141517

@ -391,7 +391,7 @@ pub async fn report_quote(
/// Summary of a reported quote in the admin reports list. /// Summary of a reported quote in the admin reports list.
/// ///
/// Returned by `GET /api/admin/reports`. /// Returned by `GET /api/admin/reports`.
#[derive(Debug, Clone, Deserialize)] #[derive(Debug, Clone, Deserialize, PartialEq)]
pub struct ReportSummary { pub struct ReportSummary {
/// The ID of the reported quote. /// The ID of the reported quote.
pub quote_id: String, pub quote_id: String,
@ -408,7 +408,7 @@ pub struct ReportSummary {
/// Paginated list of reported quotes. /// Paginated list of reported quotes.
/// ///
/// Returned by `GET /api/admin/reports?page=N`. /// Returned by `GET /api/admin/reports?page=N`.
#[derive(Debug, Clone, Deserialize)] #[derive(Debug, Clone, Deserialize, PartialEq)]
pub struct ReportListResponse { pub struct ReportListResponse {
/// Summaries of reported quotes on this page. /// Summaries of reported quotes on this page.
pub reports: Vec<ReportSummary>, pub reports: Vec<ReportSummary>,
@ -419,7 +419,7 @@ pub struct ReportListResponse {
} }
/// A single report row within a quote's report detail. /// A single report row within a quote's report detail.
#[derive(Debug, Clone, Deserialize)] #[derive(Debug, Clone, Deserialize, PartialEq)]
pub struct ReportRow { pub struct ReportRow {
/// Unique report ID. /// Unique report ID.
pub id: String, pub id: String,
@ -432,7 +432,7 @@ pub struct ReportRow {
/// Full details for a reported quote: the quote plus all individual reports. /// Full details for a reported quote: the quote plus all individual reports.
/// ///
/// Returned by `GET /api/admin/reports/:quote_id`. /// Returned by `GET /api/admin/reports/:quote_id`.
#[derive(Debug, Clone, Deserialize)] #[derive(Debug, Clone, Deserialize, PartialEq)]
pub struct QuoteReports { pub struct QuoteReports {
/// The full quote object. /// The full quote object.
pub quote: quotesdb::Quote, pub quote: quotesdb::Quote,

@ -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 crate::components::pagination::Pagination;
use wasm_bindgen_futures::spawn_local; use wasm_bindgen_futures::spawn_local;
use yew::prelude::*; use yew::prelude::*;

Loading…
Cancel
Save