수정 삭제 버튼 조건에 따라 안나오게 수정
This commit is contained in:
parent
141e725d94
commit
7000294644
@ -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}
|
||||
|
@ -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();
|
||||
|
@ -8,7 +8,6 @@ export function useQnaWrite() {
|
||||
content,
|
||||
answer: null,
|
||||
};
|
||||
console.log(newQna);
|
||||
return instance.post(`${API_URL}/qna/${lectureId}`, newQna);
|
||||
};
|
||||
|
||||
|
@ -8,6 +8,7 @@ export default function NoticeListPage() {
|
||||
const { data } = useFreeboards(lectureId);
|
||||
const notices = data?.data;
|
||||
|
||||
console.log(notices);
|
||||
return (
|
||||
<ArticleBoard
|
||||
title="자유게시판"
|
||||
|
@ -24,6 +24,7 @@ export default function QuestionDetailPage() {
|
||||
content={qna.content}
|
||||
answer={qna?.answer}
|
||||
onDelete={handleDelete}
|
||||
isMine={qna.mine}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user