mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-02-16 18:52:06 +00:00
Refactor: rename [:id] to [:postId] for api routes
This commit is contained in:
@@ -28,7 +28,7 @@ const BeerStyleCommentsSection: FC<BeerStyleCommentsSectionProps> = ({ beerStyle
|
||||
const commentSectionRef: MutableRefObject<HTMLDivElement | null> = useRef(null);
|
||||
|
||||
const handleDeleteRequest = async (id: string) => {
|
||||
const response = await fetch(`/api/beer-style-comments/${id}`, {
|
||||
const response = await fetch(`/api/beers/styles/${beerStyle.id}/comments/${id}`, {
|
||||
method: 'DELETE',
|
||||
});
|
||||
|
||||
@@ -41,7 +41,7 @@ const BeerStyleCommentsSection: FC<BeerStyleCommentsSectionProps> = ({ beerStyle
|
||||
id: string,
|
||||
data: z.infer<typeof CreateCommentValidationSchema>,
|
||||
) => {
|
||||
const response = await fetch(`/api/beer-style-comments/${id}`, {
|
||||
const response = await fetch(`/api/beers/styles/${beerStyle.id}/comments/${id}`, {
|
||||
method: 'PUT',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ content: data.content, rating: data.rating }),
|
||||
|
||||
Reference in New Issue
Block a user