mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-02-16 18:52:06 +00:00
Refactor: further refactoring of api requests.
This commit is contained in:
@@ -10,7 +10,7 @@ import createErrorToast from '@/util/createErrorToast';
|
||||
|
||||
import BeerStyleQueryResult from '@/services/posts/beer-style-post/schema/BeerStyleQueryResult';
|
||||
import useBeerStyleComments from '@/hooks/data-fetching/beer-style-comments/useBeerStyleComments';
|
||||
import sendCreateBeerStyleCommentRequest from '@/requests/comments/beer-style-comment/sendCreateBeerStyleCommentRequest';
|
||||
import { sendCreateBeerStyleCommentRequest } from '@/requests/comments/beer-style-comment';
|
||||
import CommentForm from '../ui/CommentForm';
|
||||
|
||||
interface BeerCommentFormProps {
|
||||
@@ -35,8 +35,7 @@ const BeerStyleCommentForm: FunctionComponent<BeerCommentFormProps> = ({
|
||||
const loadingToast = toast.loading('Posting a new comment...');
|
||||
try {
|
||||
await sendCreateBeerStyleCommentRequest({
|
||||
content: data.content,
|
||||
rating: data.rating,
|
||||
body: { content: data.content, rating: data.rating },
|
||||
beerStyleId: beerStyle.id,
|
||||
});
|
||||
reset();
|
||||
|
||||
Reference in New Issue
Block a user