reactions-sort-order-fix
Some checks failed
deploy / deploy (push) Failing after 1m22s

This commit is contained in:
Untone 2023-12-10 01:47:22 +03:00
parent de63f313a5
commit 159c151ae7
2 changed files with 29 additions and 9 deletions

View File

@ -408,7 +408,7 @@ async def load_reactions_by(_, info, by, limit=50, offset=0):
# sort if by stat is present
if by.get("stat"):
reactions = sorted(reactions, key=lambda r: r.stat.get(by["stat"]) or r.created_at)
reactions = sorted(reactions, key=lambda r: r.stat.get(by["stat"]) or r.created_at, reverse=True)
return reactions

View File

@ -13,22 +13,42 @@ enum ReactionStatus {
}
enum ReactionKind {
LIKE
DISLIKE
# collabs
AGREE
DISAGREE
ASK
PROPOSE
PROOF
DISPROOF
COMMENT
QUOTE
PROPOSE
ASK
REMARK
FOOTNOTE
ACCEPT
REJECT
# public feed
QUOTE
COMMENT
LIKE
DISLIKE
}
class ReactionKind(Enumeration):
# TYPE = <reaction index> # rating diff
# editor mode
AGREE = "AGREE" # +1
DISAGREE = "DISAGREE" # -1
ASK = "ASK" # +0
PROPOSE = "PROPOSE" # +0
PROOF = "PROOF" # +1
DISPROOF = "DISPROOF" # -1
ACCEPT = "ACCEPT" # +1
REJECT = "REJECT" # -1
# public feed
QUOTE = "QUOTE" # +0 TODO: use to bookmark in collection
COMMENT = "COMMENT" # +0
LIKE = "LIKE" # +1
DISLIKE = "DISLIKE" # -1
enum FollowingEntity {
TOPIC
AUTHOR