Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getSubredditInfoByName's type property is returned in upper case, docs say it should be lower case #159

Open
devvit-help-bot bot opened this issue Feb 7, 2025 · 0 comments

Comments

@devvit-help-bot
Copy link

Details

There's an inconsistency between the value of the type property on the return values of getSubredditInfoByName vs getCurrentSubreddit.

getCurrentSubreddit returns the value in lower case, consistent with the [docs]https://developers.reddit.com/docs/api/redditapi/modules/models#subreddittype) for SubredditType, but getSubredditInfoByName returns it in upper case. E.g.

  const sub1 = await context.reddit.getCurrentSubreddit();
  const sub2 = await context.reddit.getSubredditInfoByName("unitedkingdom");
  console.log(sub1.type, sub2.type);

returns public PUBLIC, not public public as it should.

Additional info

Discord message: _There's an inconsistency between the value of the type property on the return values of getSubredditInfoByName vs getCurrentSubreddit.

getCurrentSubreddit returns the value in lower case, consistent with the [docs]https://developers.reddit.com/docs/api/redditapi/modules/models#subreddittype) for SubredditType, but getSubredditInfoByName returns it in upper case. E.g.

  const sub1 = await context.reddit.getCurrentSubreddit();
  const sub2 = await context.reddit.getSubredditInfoByName("unitedkingdom");
  console.log(sub1.type, sub2.type);

returns public PUBLIC, not public public as it should._

Message author: big.wheel

Discord link: https://discord.com/channels/1050224141732687912/1050227353311248404/1329736609725419573

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

0 participants