Add Tagline structs (#80)

* Add Tagline structs

* updated is an option<string>

* Address PR Comments
This commit is contained in:
Anon 2022-11-18 11:19:56 -06:00 committed by GitHub
parent ad5be5ce3a
commit 14ed320d90
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 0 deletions

View file

@ -500,6 +500,10 @@ export class EditSite {
@Transform(({ value }) => toUndefined(value), { toPlainOnly: true })
@Expose()
blocked_instances: Option<string[]>;
@Transform(({ value }) => toOption(value), { toClassOnly: true })
@Transform(({ value }) => toUndefined(value), { toPlainOnly: true })
@Expose()
taglines: Option<string[]>;
auth: string;
constructor(init: EditSite) {

View file

@ -569,3 +569,14 @@ export class PrivateMessageReport {
@Expose()
updated: Option<string>;
}
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<string>;
}

View file

@ -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<Tagline[]>;
counts: SiteAggregates;
}