lemmy icon indicating copy to clipboard operation
lemmy copied to clipboard

[Bug]: PostReportView and CommentReportView missing many properties

Open aeharding opened this issue 2 years ago • 1 comments

Requirements

  • [X] Is this a bug report? For questions or discussions use https://lemmy.ml/c/lemmy_support
  • [X] Did you check to see if this issue already exists?
  • [X] Is this only a single bug? Do not put multiple bugs in one issue.
  • [X] Is this a backend issue? Use the lemmy-ui repo for UI / frontend issues.

Summary

(I'm not sure if this should be filed as a bug or enhancement, but given many existing shared properties, I thought this may be a bug.)

The PostReportView is missing many properties that are found on PostView (and likewise for CommentReportView and CommentView). These properties are important for apps that rely on them when rendering the post/comment to show alongside the report in the UI.

Voyager for example has to make a separate API call per post/comment to get the PostView and CommentView because these properties are missing that it depends on in the report UI, such as saved and subscribed.

As an alternative to adding the below missing fields, PostReportView could add post_view: PostView, and PostCommentView could add comment_view: CommentView, and then the miscellaneous properties could be removed. That could potentially be a less brittle solution.

PostReportView missing:

  • (post_)creator_is_moderator
  • (post_)creator_is_admin
  • (post_)creator_blocked
  • subscribed
  • saved
  • read
  • unread_comments

CommentReportView missing:

  • (comment_)creator_is_moderator
  • (comment_)creator_is_admin
  • (comment_)creator_blocked
  • subscribed
  • saved

Steps to Reproduce

N/A

Technical Details

N/A

Version

0.19.0-rc.7

Lemmy Instance URL

No response

aeharding avatar Nov 25 '23 05:11 aeharding

I agree, it'd be good to have these. At least for now, I'd just use nullish / zero defaults for these, until I get around to adding them in the back-end.

dessalines avatar Dec 06 '23 19:12 dessalines