Skip to content

Commit

Permalink
Fix : Admin 엑셀 다운 로직 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
teagu123 committed Jul 3, 2024
1 parent e08d4c5 commit 0073cdd
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 10 deletions.
2 changes: 0 additions & 2 deletions src/components/application/ApplicationForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { useNavigate } from 'react-router-dom';
import { useState, useEffect } from 'react';
import * as z from 'zod';
import * as A from './ApplicationStyle';

import { applicationSchema } from '../application/ApplicationSchema';
import ApplicationModal from './modal/ApplicationModal';
import SelectedOption from './SelectedOption';
Expand Down Expand Up @@ -170,7 +169,6 @@ const ApplicationForm = () => {
if (userData) {
setValue('email', userData.email);
trigger('email');

setUniversityId(userData.universityId);
}
if (hackathonResponse.data.length === 0) {
Expand Down
4 changes: 1 addition & 3 deletions src/components/application/ApplicationModify.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,7 @@ const ApplicationForm = () => {
);
setValue(
'reasonForNotOffline',
hackathonData.reasonForNotOffline === ''
? ''
: hackathonData.reasonForNotOffline!,
hackathonData.reasonForNotOffline === '기본값' ? '기본값' : '',
);
}
}, [hackathonData]);
Expand Down
29 changes: 25 additions & 4 deletions src/pages/admin/components/hackathon/components/TableBottom.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ interface ExcelType {
universityName: string;
phone: string;
offlineParticipation: boolean | string;
hackathonParts: string[] | string;
hackathonParts: any;
email: string;
teamName: string;
}
Expand All @@ -24,13 +24,34 @@ const HackathonTableBottom = () => {
const workbook = XLSX.utils.book_new();
const body: ExcelType[] = [];

// users.map(el => {
// body.push({
// name: el.name,
// universityName: el.universityName!,
// phone: el.phone!,
// offlineParticipation: el.offlineParticipation!,
// hackathonParts: el.hackathonParts![0],
// email: el.email,
// teamName: el.teamName!,
// });
// });
users.map(el => {
body.push({
name: el.name,
universityName: el.universityName!,
phone: el.phone!,
offlineParticipation: el.offlineParticipation!,
hackathonParts: el.hackathonParts![0],
offlineParticipation: el.offlineParticipation!
? '참여'
: '불참',
hackathonParts:
el.hackathonParts![0] +
(el.hackathonParts![1]
? ', ' + el.hackathonParts![1]
: '') +
(el.hackathonParts![2]
? ', ' + el.hackathonParts![2]
: '') +
(el.hackathonParts![3] ? ', ' + el.hackathonParts![3] : ''),
email: el.email,
teamName: el.teamName!,
});
Expand Down Expand Up @@ -62,7 +83,7 @@ const HackathonTableBottom = () => {
{ wpx: 180 },
{ wpx: 200 },
{ wpx: 100 },
{ wpx: 130 },
{ wpx: 230 },
{ wpx: 200 },
{ wpx: 200 },
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ const TableHackathonList: React.FC<TableUserListProps> = props => {
)}
</Table>
<Table className="part">
{props!.hackathonParts!.map(el => el)}
{props!.hackathonParts!.map(el => (
<div>{el}</div>
))}
</Table>
<Table className="email">{props.email}</Table>
<Table className="teamname">{props.teamName}</Table>
Expand Down

0 comments on commit 0073cdd

Please sign in to comment.