Did more work to beer post page, seed

Worked on comments and beer recs features. Fine tuning database seed amounts.
This commit is contained in:
Aaron William Po
2023-01-29 21:53:05 -05:00
parent fe277d5964
commit 0b96c8f1f5
38 changed files with 833 additions and 221 deletions

View File

@@ -0,0 +1,26 @@
import { z } from 'zod';
import BeerCommentValidationSchema from '../validation/CreateBeerCommentValidationSchema';
const sendCreateBeerCommentRequest = async ({
beerPostId,
content,
rating,
}: z.infer<typeof BeerCommentValidationSchema>) => {
const response = await fetch(`/api/beers/${beerPostId}/comments`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
beerPostId,
content,
rating,
}),
});
const data = await response.json();
console.log(data);
};
export default sendCreateBeerCommentRequest;

View File

@@ -1,4 +1,4 @@
import BeerPostValidationSchema from '@/validation/BeerPostValidationSchema';
import BeerPostValidationSchema from '@/validation/CreateBeerPostValidationSchema';
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
import { z } from 'zod';