mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-02-16 18:52:06 +00:00
Work on brewery page, refactors
Refactor query types to explicitly use z.infer
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { BeerCommentQueryResult } from '@/services/BeerComment/schema/BeerCommentQueryResult';
|
||||
import BeerCommentQueryResult from '@/services/BeerComment/schema/BeerCommentQueryResult';
|
||||
import BeerCommentValidationSchema from '@/services/BeerComment/schema/CreateBeerCommentValidationSchema';
|
||||
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
||||
import { z } from 'zod';
|
||||
@@ -14,14 +14,8 @@ const sendCreateBeerCommentRequest = async ({
|
||||
}: z.infer<typeof BeerCommentValidationSchemaWithId>) => {
|
||||
const response = await fetch(`/api/beers/${beerPostId}/comments`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify({
|
||||
beerPostId,
|
||||
content,
|
||||
rating,
|
||||
}),
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ beerPostId, content, rating }),
|
||||
});
|
||||
|
||||
const data = await response.json();
|
||||
|
||||
Reference in New Issue
Block a user