165 Filter statements by createAt() and also fix toggling multiple answers not updating properly #166
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
165 Filter statements by createAt() and also fix toggling multiple answers not updating properly
This closes issue #165 that I added, which also explains this PR pretty well but here are the things that I did:
I_agree
andothers_agree
, only one of the columns updates. This was due to a setState error in my code, so I fixed it by changingcurrentAnswer
to update its value for I_agree and others_agree accordingly before sending data to the database/getanswers
and/getAgreementPercentage
to filter based oncreateAt()
instead ofid
, which is better practicecreateAt()
, which only records up to the second (an example is2024-07-19 08:11:03
). So if a user clicks multiple times in one second, the createAt() time is the same for both entries so both entries are displayed. I think to fix this, we could add milliseconds tocreateAt()
or filter based on a different way -- will ask Mark about this