Add the post author to the return result (#208)
All checks were successful
Stage / build (push) Successful in 8s
Stage / rsync (push) Successful in 6s

- Add the post author to the return result
- Update tests to accommodate for this change
- Update the documentation for this change

#110

Reviewed-on: #208
Reviewed-by: VylpesTester <tester@vylpes.com>
Co-authored-by: Ethan Lane <ethan@vylpes.com>
Co-committed-by: Ethan Lane <ethan@vylpes.com>
This commit is contained in:
Ethan Lane 2024-08-02 17:47:47 +01:00 committed by Vylpes
parent d85c812fbb
commit 50e4790fbf
9 changed files with 21 additions and 2 deletions

View file

@ -1,6 +1,7 @@
export default interface IFetchResult {
data: {
archived: boolean,
author: string,
downs: number,
hidden: boolean,
permalink: string,

View file

@ -1,5 +1,6 @@
export default interface IRedditResult {
Archived: boolean,
Author: string,
Downs: number,
Hidden: boolean,
Permalink: string,

View file

@ -12,6 +12,7 @@ export default class OutputHelper {
}
outputLines.push(`Archived = ${result.Archived}`);
outputLines.push(`Author = ${result.Author}`);
outputLines.push(`Downvotes = ${result.Downs}`);
outputLines.push(`Hidden = ${result.Hidden}`);
outputLines.push(`Permalink = ${result.Permalink}`);

View file

@ -118,6 +118,7 @@ export default async function randomBunny(subreddit: string, sortBy: "new" | "ho
}
const redditResult: IRedditResult = {
Author: randomData['author'],
Archived: randomData['archived'],
Downs: randomData['downs'],
Hidden: randomData['hidden'],