This repository has been archived by the owner on Aug 3, 2023. It is now read-only.
Feat: Add the ability to create a comment to the post #13
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.
I added a link to the most relevant documentation and enabled the ability to add comments to posts.
We can also discuss the accuracy of choosing a key for comments.
For the key, I chose the solution of "author + date + slug". The reasoning behind this is that one post can have a large number of comments, and using only one of the keys such as author/date/slug immediately would not work. If we used only date/slug, then different users cannot write identical comments. Using author/slug allows us to have one post = one comment from a user, and author/date only allows for adding unique comments there.
We could have used key generation, but that would deprive us of the ability to know the key in advance.