From 14ed320d90cef700f9a93f6cbc12661d66b86ae4 Mon Sep 17 00:00:00 2001 From: Anon Date: Fri, 18 Nov 2022 11:19:56 -0600 Subject: [PATCH] Add Tagline structs (#80) * Add Tagline structs * updated is an option * Address PR Comments --- src/interfaces/api/site.ts | 4 ++++ src/interfaces/source.ts | 11 +++++++++++ src/interfaces/views.ts | 5 +++++ 3 files changed, 20 insertions(+) diff --git a/src/interfaces/api/site.ts b/src/interfaces/api/site.ts index b165e8f..d558a71 100644 --- a/src/interfaces/api/site.ts +++ b/src/interfaces/api/site.ts @@ -500,6 +500,10 @@ export class EditSite { @Transform(({ value }) => toUndefined(value), { toPlainOnly: true }) @Expose() blocked_instances: Option; + @Transform(({ value }) => toOption(value), { toClassOnly: true }) + @Transform(({ value }) => toUndefined(value), { toPlainOnly: true }) + @Expose() + taglines: Option; auth: string; constructor(init: EditSite) { diff --git a/src/interfaces/source.ts b/src/interfaces/source.ts index 602a669..33b8063 100644 --- a/src/interfaces/source.ts +++ b/src/interfaces/source.ts @@ -569,3 +569,14 @@ export class PrivateMessageReport { @Expose() updated: Option; } + +export class Tagline { + id: number; + local_site_id: number; + content: string; + published: string; + @Transform(({ value }) => toOption(value), { toClassOnly: true }) + @Transform(({ value }) => toUndefined(value), { toPlainOnly: true }) + @Expose() + updated: Option; +} diff --git a/src/interfaces/views.ts b/src/interfaces/views.ts index 736d9ca..0c2ebfd 100644 --- a/src/interfaces/views.ts +++ b/src/interfaces/views.ts @@ -40,6 +40,7 @@ import { PrivateMessageReport, RegistrationApplication, Site, + Tagline, } from "./source"; export class PersonViewSafe { @@ -87,6 +88,10 @@ export class SiteView { local_site: LocalSite; @Type(() => LocalSiteRateLimit) local_site_rate_limit: LocalSiteRateLimit; + @Transform(({ value }) => toOption(value), { toClassOnly: true }) + @Transform(({ value }) => toUndefined(value), { toPlainOnly: true }) + @Expose() + taglines: Option; counts: SiteAggregates; }