Skip to content

Commit

Permalink
feat(detail/tab): feat: modify comment api
Browse files Browse the repository at this point in the history
  • Loading branch information
JSH-data committed Feb 3, 2024
1 parent c7eefd7 commit f2a6a14
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions components/domains/detail/tab/review/ReviewTextarea.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import type { ChangeEvent } from "react";
import { useState, useContext } from "react";
import { useState } from "react";
import styled, { css } from "styled-components";
import Rating from "@/components/common/rating";
import Typography from "@/components/common/text/Typography";
import { AuthUserInfo } from "@/contexts";
import useAuthUserStorage from "@/hooks/authUserStorage";
import { usePostComment } from "@/queries";

export default function ReviewTextarea({ artId }: { artId: number }) {
const { authUser } = useContext(AuthUserInfo.Context);
const { userAuth } = useAuthUserStorage();
const [rating, setRating] = useState(0);
const [review, setReview] = useState("");
const postComment = usePostComment(artId);
Expand All @@ -17,12 +17,12 @@ export default function ReviewTextarea({ artId }: { artId: number }) {
};

const postReview = () => {
if (authUser?.id) {
if (userAuth.id) {
postComment({
score: rating,
description: review,
art: artId,
author: Number(authUser.id),
author: Number(userAuth.id),
});
}
};
Expand Down

0 comments on commit f2a6a14

Please sign in to comment.