From 4cac67c09909f3c77a18d2723cdcc760aa522d4c Mon Sep 17 00:00:00 2001 From: Dessalines Date: Mon, 2 Dec 2024 18:05:38 -0500 Subject: [PATCH] Use internal tagging. --- Cargo.lock | 1 + crates/db_views/src/structs.rs | 2 ++ 2 files changed, 3 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index b000f9741..475946d6e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2549,6 +2549,7 @@ dependencies = [ "lemmy_db_views", "lemmy_db_views_actor", "lemmy_utils", + "regex", "serde", "serde_json", "serde_with", diff --git a/crates/db_views/src/structs.rs b/crates/db_views/src/structs.rs index cb80c5a2d..0e3bbe6f4 100644 --- a/crates/db_views/src/structs.rs +++ b/crates/db_views/src/structs.rs @@ -282,6 +282,8 @@ pub struct ReportCombinedViewInternal { #[derive(Debug, PartialEq, Serialize, Deserialize, Clone)] #[cfg_attr(feature = "full", derive(TS))] #[cfg_attr(feature = "full", ts(export))] +// Use serde's internal tagging, to work easier with javascript libraries +#[serde(tag = "type_")] pub enum ReportCombinedView { Post(PostReportView), Comment(CommentReportView),