Add like count and extracted like button out of parent

This commit is contained in:
Aaron William Po
2023-02-15 21:35:18 -05:00
parent 5561f209e9
commit d50ce7497b
6 changed files with 97 additions and 68 deletions

View File

@@ -1,8 +1,7 @@
import BeerPostQueryResult from '@/services/BeerPost/schema/BeerPostQueryResult';
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
const sendLikeRequest = async (beerPost: BeerPostQueryResult) => {
const response = await fetch(`/api/beers/${beerPost.id}/like`, {
const sendLikeRequest = async (beerPostId: string) => {
const response = await fetch(`/api/beers/${beerPostId}/like`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',