Use internal tagging.

This commit is contained in:
Dessalines 2024-12-02 18:05:38 -05:00
parent 46748210ee
commit 4cac67c099
2 changed files with 3 additions and 0 deletions

1
Cargo.lock generated
View file

@ -2549,6 +2549,7 @@ dependencies = [
"lemmy_db_views", "lemmy_db_views",
"lemmy_db_views_actor", "lemmy_db_views_actor",
"lemmy_utils", "lemmy_utils",
"regex",
"serde", "serde",
"serde_json", "serde_json",
"serde_with", "serde_with",

View file

@ -282,6 +282,8 @@ pub struct ReportCombinedViewInternal {
#[derive(Debug, PartialEq, Serialize, Deserialize, Clone)] #[derive(Debug, PartialEq, Serialize, Deserialize, Clone)]
#[cfg_attr(feature = "full", derive(TS))] #[cfg_attr(feature = "full", derive(TS))]
#[cfg_attr(feature = "full", ts(export))] #[cfg_attr(feature = "full", ts(export))]
// Use serde's internal tagging, to work easier with javascript libraries
#[serde(tag = "type_")]
pub enum ReportCombinedView { pub enum ReportCombinedView {
Post(PostReportView), Post(PostReportView),
Comment(CommentReportView), Comment(CommentReportView),