Skip to content

Commit

Permalink
Merge pull request #395 from TEAM-BEAT/feat/#394/CSVBugFix
Browse files Browse the repository at this point in the history
[Bug/#394] CSV 버그 수정
  • Loading branch information
ocahs9 authored Sep 13, 2024
2 parents ca82362 + c96b452 commit d0cc056
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/pages/ticketholderlist/TicketHolderList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ const headers = [
{ label: "예매상태", key: "bookingStatus" },
];

const CSVDataArr: CSVDataType[] = [];

const TicketHolderList = () => {
const [CSVDataArr, setCSVDataArr] = useState<CSVDataType[]>([]);

const { performanceId } = useParams();
const [reservedCount, setReservedCount] = useState(0);

Expand Down Expand Up @@ -93,20 +93,24 @@ const TicketHolderList = () => {
setInitBookingStatuses(immutableBookingStatuses);

//전체 데이터를 기반으로 csv 추출 데이터 구축
const tempCSVDataArr: CSVDataType[] = [];

data.bookingList.map((item) => {
const date = item.createdAt.split("T")[0];
const time = item.createdAt.split("T")[1].slice(0, 5);
const formattedDate = date?.replace(/-/g, ".");
const formattedCreateTime = `${formattedDate} ${time}`;

CSVDataArr.push({
tempCSVDataArr.push({
createdAt: formattedCreateTime,
scheduleNumber: `${convertingNumber(item.scheduleNumber)}회차`,
bookerName: item.bookerName,
purchaseTicketCount: `${item.purchaseTicketCount}매`,
bookerPhoneNumber: item.bookerPhoneNumber,
bookingStatus: convertingBookingStatus(item.bookingStatus),
});

setCSVDataArr(tempCSVDataArr);
});
}
}, [data]);
Expand Down

0 comments on commit d0cc056

Please sign in to comment.