As mentioned in #116, the blog's "Like 👍" functionality needs improvement.
Tasks
[ ] When the user clicks the Like button, they should get a pop-up modal prompting them to register/login first.
[ ] If the user chooses to login/register, then allow them to mutate the Like count only once.
Currently, the usePostLikeBlog function (hooks/Queries/blog/usePostLikeBlog) currently uses axios only to make a POST request. Here's what you should change:
[ ] The usePostLikeBlog function should be moved to hooks/Mutations/blog/usePostLikeBlog since it's a mutation and not a query
[ ] Instead of using axios, use a privateAxioswith@tanstack/react-query(reference:hooks/Mutations/shop/useMakeOrder`)
Description
As mentioned in #116, the blog's "Like 👍" functionality needs improvement.
Tasks
Currently, the
usePostLikeBlog
function (hooks/Queries/blog/usePostLikeBlog
) currently usesaxios
only to make aPOST
request. Here's what you should change:usePostLikeBlog
function should be moved tohooks/Mutations/blog/usePostLikeBlog
since it's a mutation and not a queryaxios
, use a privateAxioswith
@tanstack/react-query(reference:
hooks/Mutations/shop/useMakeOrder`)