Skip to content

Implemented sorting at a lower level than before#18

Open
jcheng1103 wants to merge 1 commit into
merging_attempt_2from
fixing_sorting
Open

Implemented sorting at a lower level than before#18
jcheng1103 wants to merge 1 commit into
merging_attempt_2from
fixing_sorting

Conversation

@jcheng1103

Copy link
Copy Markdown
Collaborator

Previous code for sorting caused a test case to fail.

The new code cases on whether a post is important and if it is a smaller value is inserted for votes or for timestamp to cause posts to be at the top.

Resolves #8 .

New code for sorting can be found in src/topics/posts.js
@jcheng1103 jcheng1103 added the bug Something isn't working label Feb 29, 2024
@jcheng1103 jcheng1103 added this to the Sprint2 milestone Feb 29, 2024
@jcheng1103 jcheng1103 self-assigned this Feb 29, 2024
@GabrielAguirre1

Copy link
Copy Markdown
Collaborator

Looks good to me!

Comment thread src/posts/bookmarks.js
module.exports = function (Posts) {
Posts.is_important = async function (pid) {
return await Posts.getPostField(pid, 'important');
// typeof(res) === 'number' or res === null

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason that you commented out this type check?

Otherwise, looks good to me!

@jcheng1103 jcheng1103 removed the request for review from corincewang March 1, 2024 01:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants