Merge branch 'frontend' into 'FE/FixMaxLength'
# Conflicts: # frontend/src/pages/TeacherReportsetDetailPage/TeacherReportsetDetailPage.jsx
This commit is contained in:
commit
486ebb1a62
@ -8,7 +8,6 @@ export default function NoticeListPage() {
|
|||||||
const { data } = useFreeboards(lectureId);
|
const { data } = useFreeboards(lectureId);
|
||||||
const notices = data?.data;
|
const notices = data?.data;
|
||||||
|
|
||||||
console.log(notices);
|
|
||||||
return (
|
return (
|
||||||
<ArticleBoard
|
<ArticleBoard
|
||||||
title="자유게시판"
|
title="자유게시판"
|
||||||
@ -18,7 +17,7 @@ export default function NoticeListPage() {
|
|||||||
<ArticleLink
|
<ArticleLink
|
||||||
key={`${notice.id}`}
|
key={`${notice.id}`}
|
||||||
title={notice.title}
|
title={notice.title}
|
||||||
sub={`${notice.createdAt[0]}. ${notice.createdAt[1]}. ${notice.createdAt[2]}. ${notice.createdAt[3]}:${notice.createdAt[4]}`}
|
sub={`${new Date(notice.createdAt).toLocaleDateString()} ${new Date(notice.createdAt).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })}`}
|
||||||
to={`${notice.id}`}
|
to={`${notice.id}`}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
|
@ -20,9 +20,7 @@ export default function NoticeListPage() {
|
|||||||
<ArticleLink
|
<ArticleLink
|
||||||
key={`${notice.id}`}
|
key={`${notice.id}`}
|
||||||
title={notice.title}
|
title={notice.title}
|
||||||
//Todo: createdAt을 이용하여 날짜 표시했는데 Q&A에서 나오는 날짜 형식이랑 공지사항에서 나오는 날짜 형식이랑 달라서 수정해야함.
|
sub={`${new Date(notice.createdAt).toLocaleDateString()} ${new Date(notice.createdAt).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })}`}
|
||||||
// + Q&A 글쓰기 버튼이 너무 커서 글 밀어내는 느낌 있음.
|
|
||||||
sub={`${notice.createdAt[0]}. ${notice.createdAt[1]}. ${notice.createdAt[2]}. ${notice.createdAt[3]}:${notice.createdAt[4]}`}
|
|
||||||
to={`${notice.id}`}
|
to={`${notice.id}`}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
|
@ -11,29 +11,13 @@ export default function TeacherReportsetDetailPage() {
|
|||||||
const { data } = useReportSetDetail(reportsetId);
|
const { data } = useReportSetDetail(reportsetId);
|
||||||
const reports = data?.data;
|
const reports = data?.data;
|
||||||
|
|
||||||
const formatDate = (dateArray) => {
|
|
||||||
const date = new Date(...dateArray.slice(0, 6));
|
|
||||||
return date.toLocaleString('ko-KR', {
|
|
||||||
hour12: true,
|
|
||||||
timeZone: 'Asia/Seoul',
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleDelete = async (e) => {
|
|
||||||
e.preventDefault();
|
|
||||||
await reportsetDelete(reportsetId);
|
|
||||||
navigate('..');
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
|
||||||
<ArticleBoard
|
<ArticleBoard
|
||||||
title="퀴즈 조회"
|
title="퀴즈 조회"
|
||||||
canCreate={false}
|
canCreate={false}
|
||||||
>
|
>
|
||||||
{reports.length &&
|
{reports.length &&
|
||||||
reports.map?.((report) => {
|
reports.map?.((report) => {
|
||||||
const formattedDate = formatDate(report.date);
|
|
||||||
return (
|
return (
|
||||||
<ArticleLink
|
<ArticleLink
|
||||||
key={`${report.reportId}`}
|
key={`${report.reportId}`}
|
||||||
@ -42,18 +26,11 @@ export default function TeacherReportsetDetailPage() {
|
|||||||
? `${report.name} - 미응시`
|
? `${report.name} - 미응시`
|
||||||
: `${report.name} - ${report.title} 점수: ${report.correctCount}/${report.allCount}`
|
: `${report.name} - ${report.title} 점수: ${report.correctCount}/${report.allCount}`
|
||||||
}
|
}
|
||||||
sub={`${formattedDate}`}
|
sub={`${new Date(report.testAt).toLocaleDateString()} ${new Date(report.testAt).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })}`}
|
||||||
to={`../report/${report.reportId}`}
|
to={`../report/${report.reportId}`}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</ArticleBoard>
|
</ArticleBoard>
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
onClick={handleDelete}
|
|
||||||
>
|
|
||||||
리포트 삭제
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -8,26 +8,17 @@ export default function TeacherReportsetPage() {
|
|||||||
const { data } = useReportSets(lectureId);
|
const { data } = useReportSets(lectureId);
|
||||||
const reports = data?.data;
|
const reports = data?.data;
|
||||||
|
|
||||||
const formatDate = (dateArray) => {
|
|
||||||
const date = new Date(...dateArray.slice(0, 6));
|
|
||||||
return date.toLocaleString('ko-KR', {
|
|
||||||
hour12: true,
|
|
||||||
timeZone: 'Asia/Seoul',
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ArticleBoard
|
<ArticleBoard
|
||||||
title="퀴즈 성적 목록"
|
title="퀴즈 성적 목록"
|
||||||
canCreate={false}
|
canCreate={false}
|
||||||
>
|
>
|
||||||
{reports.map?.((report) => {
|
{reports.map?.((report) => {
|
||||||
const formattedDate = formatDate(report.testAt);
|
|
||||||
return (
|
return (
|
||||||
<ArticleLink
|
<ArticleLink
|
||||||
key={`${report.reportSetId}`}
|
key={`${report.reportSetId}`}
|
||||||
title={`${report.quizSetTitle}`}
|
title={`${report.quizSetTitle}`}
|
||||||
sub={formattedDate}
|
sub={`${new Date(report.testAt).toLocaleDateString()} ${new Date(report.testAt).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })}`}
|
||||||
to={`${report.reportSetId}`}
|
to={`${report.reportSetId}`}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user