Skip to content

Commit

Permalink
hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
keemsebin committed Oct 2, 2024
1 parent 1ce32c7 commit 6bb2a70
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 16 deletions.
12 changes: 3 additions & 9 deletions src/components/report/Form.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
import {
ChangeEvent,
Dispatch,
SetStateAction,
useEffect,
useState,
} from 'react';
import { ChangeEvent, Dispatch, SetStateAction } from 'react';
import Datepicker from 'react-tailwindcss-datepicker';
import {
DateRangeType,
Expand Down Expand Up @@ -34,7 +28,7 @@ export default function Form({
id,
}: ReportProps) {
const { openModal, visible, closeModal, modalRef } = useModal();
const { date, participants, place, content, startTime, endTime, ImageUrls } =
const { date, participants, place, content, startTime, endTime, imageUrls } =
report;

function handleChange(
Expand Down Expand Up @@ -151,7 +145,7 @@ export default function Form({
<UploadImage
image={uploadFiles}
setImage={setImage}
imageUrls={ImageUrls}
imageUrls={imageUrls}
setRemoveFile={setRemoveFile}
id={id}
/>
Expand Down
6 changes: 3 additions & 3 deletions src/components/report/detail/Report.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ type Props = {
};

export default function Report({ reportData, term }: Props) {
const { content, ImageUrls, participants } = reportData ?? {};
const { content, imageUrls, participants } = reportData ?? {};

const [data, setData] = useState(reportData);

const showImage =
ImageUrls && ImageUrls[0] ? parseImgUrl(ImageUrls[0]) : UnSubmitImage;
imageUrls && imageUrls[0] ? parseImgUrl(imageUrls[0]) : UnSubmitImage;
useEffect(() => {
setData(data);
}, [ImageUrls, data]);
}, [imageUrls, data]);

const isParticipants =
participants?.filter((participant) => participant.name).length > 0;
Expand Down
4 changes: 2 additions & 2 deletions src/types/report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export type EditReport = {
startTime: string;
endTime: string;
content: string;
ImageUrls?: string[];
imageUrls?: string[];
uploadFiles?: File | null;
participants: StudentInfo[];
token?: string;
Expand Down Expand Up @@ -63,7 +63,7 @@ export type ReportResponse = {
endDate: string;
startTime: string;
endTime: string;
ImageUrls: string[];
imageUrls: string[];
participants: StudentInfo[];
};

Expand Down
4 changes: 2 additions & 2 deletions src/utils/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const parseReportResponseToEditReport = (
place,
content,
participants,
ImageUrls,
imageUrls,
startDate: start,
endDate: end,
} = report;
Expand All @@ -66,7 +66,7 @@ export const parseReportResponseToEditReport = (
content,
date: { startDate, endDate },
startTime,
ImageUrls,
imageUrls,
endTime,
participants,
};
Expand Down

0 comments on commit 6bb2a70

Please sign in to comment.