mirror of
https://github.com/PretendoNetwork/miiverse-api.git
synced 2026-07-18 16:41:25 -05:00
updated Post.json() topic_tag generation
This commit is contained in:
parent
e529afe540
commit
1fd63bee29
|
|
@ -142,11 +142,13 @@ PostSchema.method<HydratedPostDocument>('formatScreenshot', function formatScree
|
|||
}
|
||||
});
|
||||
|
||||
PostSchema.method<HydratedPostDocument>('formatTopicTag', function formatTopicTag(): PostTopicTag {
|
||||
return {
|
||||
name: this.topic_tag,
|
||||
title_id: this.title_id
|
||||
};
|
||||
PostSchema.method<HydratedPostDocument>('formatTopicTag', function formatTopicTag(): PostTopicTag | undefined {
|
||||
if (this.topic_tag?.trim()) {
|
||||
return {
|
||||
name: this.topic_tag,
|
||||
title_id: this.title_id
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
PostSchema.method<HydratedPostDocument>('json', function json(options: PostToJSONOptions, community?: HydratedCommunityDocument): PostData {
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ export interface IPostMethods {
|
|||
cleanedAppData(): string;
|
||||
formatPainting(): PostPainting | undefined;
|
||||
formatScreenshot(): PostScreenshot | undefined;
|
||||
formatTopicTag(): PostTopicTag;
|
||||
formatTopicTag(): PostTopicTag | undefined;
|
||||
json(options: PostToJSONOptions, community?: HydratedCommunityDocument): PostData;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user