수정 삭제 버튼 조건에 따라 안나오게 수정

This commit is contained in:
minwucho 2024-08-09 13:10:50 +09:00
parent 141e725d94
commit 7000294644
6 changed files with 6 additions and 5 deletions

View File

@ -37,7 +37,6 @@ export default function ArticleDetail({
setSubmittedAnswer(null);
setIsEditing(false);
};
return (
<div className={styles.articleDetail}>
<header className={styles.header}>
@ -55,7 +54,7 @@ export default function ArticleDetail({
</div>
</div>
<div className={styles.actionGroup}>
{(isMine || (userType === 'teacher' && !isQna)) && (
{isMine && (
<>
<Link
className={styles.edit}

View File

@ -3,9 +3,8 @@ import { useAnswerWrite } from '../../../../hooks/api/useAnswerWrite';
import { useAnswerEdit } from '../../../../hooks/api/useAnswerEdit';
import { useParams } from 'react-router-dom';
import { useState } from 'react';
export default function ArticleDetailAnswerInput({ onSubmit, initialAnswer, isEditing = false }) {
import SendIcon from '/src/assets/icons/send.svg?react';
export default function ArticleDetailAnswerInput({ onSubmit, initialAnswer, isEditing = false }) {
const { answerWrite } = useAnswerWrite();
const { answerEdit } = useAnswerEdit();
const { questionId } = useParams();

View File

@ -8,7 +8,6 @@ export function useQnaWrite() {
content,
answer: null,
};
console.log(newQna);
return instance.post(`${API_URL}/qna/${lectureId}`, newQna);
};

View File

@ -8,6 +8,7 @@ export default function NoticeListPage() {
const { data } = useFreeboards(lectureId);
const notices = data?.data;
console.log(notices);
return (
<ArticleBoard
title="자유게시판"

View File

@ -24,6 +24,7 @@ export default function QuestionDetailPage() {
content={qna.content}
answer={qna?.answer}
onDelete={handleDelete}
isMine={qna.mine}
/>
);
}

View File

@ -9,6 +9,8 @@ export default function QuestionListPage() {
const { data } = useQnas(lectureId);
const questions = data?.data;
const userType = useBoundStore((state) => state.userType);
console.log(questions);
return (
<ArticleBoard
title="Q&A"