Skip to content

Commit 981928e

Browse files
authored
Chore: Map camelCase DTO properties (#121)
1 parent e8d9187 commit 981928e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+250
-254
lines changed

components/board/benefit/discount/discount.cards.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const DiscountOfferCards = ({ discountOffers }) => {
3737
<Modal.Content>
3838
<p>
3939
<Icon name="clock outline" />
40-
영업 시간: {discountOffer.open_hour}
40+
영업 시간: {discountOffer.openHour}
4141
</p>
4242
<p>
4343
<Icon name="phone" />

components/board/benefit/discount/discount.table.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ const DiscountTable = ({ discountList }) => {
2424
<Table.Cell>{discount.id}</Table.Cell>
2525
<Table.Cell>{discount.title}</Table.Cell>
2626
<Table.Cell>{discount.region}</Table.Cell>
27-
<Table.Cell>{discount.open_hour}</Table.Cell>
27+
<Table.Cell>{discount.openHour}</Table.Cell>
2828
<Table.Cell>{discount.phone}</Table.Cell>
2929
<Table.Cell>{discount.content}</Table.Cell>
3030
<Table.Cell>
31-
{moment(discount.created_at).format('YYYY-MM-DD HH:mm')}
31+
{moment(discount.createdAt).format('YYYY-MM-DD HH:mm')}
3232
</Table.Cell>
3333
<Table.Cell>
3434
<Link href={`/board/benefit/discount/update/${discount.id}`}>

components/board/calendar/calendar.table.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ const CalendarTable = ({ calendars }) => {
1515
</Table.Header>
1616
<Table.Body>
1717
{calendars.map((calendar) => {
18-
const isDisabled = moment().isAfter(moment(calendar.event_date));
19-
const dDay = moment(calendar.event_date).diff(
18+
const isDisabled = moment().isAfter(moment(calendar.eventDate));
19+
const dDay = moment(calendar.eventDate).diff(
2020
moment().format('YYYY-MM-DD'),
2121
'days',
2222
);
@@ -32,7 +32,7 @@ const CalendarTable = ({ calendars }) => {
3232
calendar.title
3333
)}
3434
</Table.Cell>
35-
<Table.Cell>{calendar.event_date}</Table.Cell>
35+
<Table.Cell>{calendar.eventDate}</Table.Cell>
3636
<Table.Cell>
3737
{dDay > 0 ? `D-${dDay}` : dDay < 0 ? `D+${-dDay}` : 'D-Day'}
3838
</Table.Cell>

components/board/notice/notice.table.jsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ const NoticeTable = ({ notices }) => {
1919
<Table.Body>
2020
{notices.map((notice) => {
2121
const isActive = moment().isBetween(
22-
moment(notice.start_datetime),
23-
moment(notice.end_datetime),
22+
moment(notice.startDatetime),
23+
moment(notice.endDatetime),
2424
);
25-
const duration = moment(notice.end_datetime).diff(
26-
moment(notice.start_datetime),
25+
const duration = moment(notice.endDatetime).diff(
26+
moment(notice.startDatetime),
2727
'hours',
2828
);
2929
return (
@@ -45,12 +45,12 @@ const NoticeTable = ({ notices }) => {
4545
<Image href={notice.link}/>
4646
</Table.Cell> */}
4747
<Table.Cell>
48-
{moment(notice.start_datetime).format('YYYY-MM-DD HH:mm')} ~{' '}
49-
{moment(notice.end_datetime).format('YYYY-MM-DD HH:mm')}
48+
{moment(notice.startDatetime).format('YYYY-MM-DD HH:mm')} ~{' '}
49+
{moment(notice.endDatetime).format('YYYY-MM-DD HH:mm')}
5050
<br />({Number(duration / 24).toFixed(0)}{duration % 24}
5151
시간)
5252
</Table.Cell>
53-
<Table.Cell>{notice.click_count}</Table.Cell>
53+
<Table.Cell>{notice.clickCount}</Table.Cell>
5454
<Table.Cell>
5555
<Link href={`/board/notice/update/${notice.id}`}>
5656
<Icon name={'edit'} />

components/board/whitebook/whitebook.create.modal.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ const WhitebookCreateModal = (props) => {
2525
const formData = new FormData();
2626
formData.append('title', title);
2727
formData.append('content', content);
28-
formData.append('show_only_login', showOnlyLogin);
28+
formData.append('showOnlyLogin', showOnlyLogin);
2929

3030
if (inputType === 'link' && link) {
3131
formData.append('link', link);
3232
} else if (inputType === 'pdf' && pdfFile) {
33-
formData.append('pdf_file', pdfFile);
33+
formData.append('pdfFile', pdfFile);
3434
} else {
3535
alert('링크 또는 PDF 파일을 입력해주세요.');
3636
return;

components/board/whitebook/whitebook.table.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ const WhitebookTable = ({ whitebooks }) => {
2929
</Table.Cell>
3030
<Table.Cell>{whitebook.content}</Table.Cell>
3131
<Table.Cell>
32-
{moment(whitebook.created_at).format('YYYY-MM-DD HH:mm')}
32+
{moment(whitebook.createdAt).format('YYYY-MM-DD HH:mm')}
3333
</Table.Cell>
34-
<Table.Cell>{whitebook.click_count}</Table.Cell>
34+
<Table.Cell>{whitebook.clickCount}</Table.Cell>
3535
</Table.Row>
3636
}
3737
/>

components/board/whitebook/whitebook.update.modal.jsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const WhitebookUpdateModal = ({ trigger, whitebook }) => {
99

1010
const [title, setTitle] = useState(whitebook.title);
1111
const [content, setContent] = useState(whitebook.content);
12-
const [showOnlyLogin, setShowOnlyLogin] = useState(whitebook.show_only_login);
12+
const [showOnlyLogin, setShowOnlyLogin] = useState(whitebook.showOnlyLogin);
1313
const [inputType, setInputType] = useState(whitebook.link ? 'link' : 'pdf');
1414
const [link, setLink] = useState(whitebook.link || '');
1515
const [uploadedPDFLink, setUploadedPDFLink] = useState(null);
@@ -39,18 +39,18 @@ const WhitebookUpdateModal = ({ trigger, whitebook }) => {
3939
const formData = new FormData();
4040
formData.append('title', title);
4141
formData.append('content', content);
42-
formData.append('show_only_login', showOnlyLogin);
42+
formData.append('showOnlyLogin', showOnlyLogin);
4343

4444
if (inputType === 'link' && link) {
4545
formData.append('link', link);
4646
} else if (inputType === 'pdf' && pdfFile) {
47-
formData.append('pdf_file', pdfFile);
47+
formData.append('pdfFile', pdfFile);
4848
} else {
4949
// title, content, show_only_login 중 하나라도 변경되었다면 수정 가능
5050
if (
5151
title !== whitebook.title ||
52-
content !== whitebook.cotent ||
53-
showOnlyLogin !== whitebook.show_only_login
52+
content !== whitebook.content ||
53+
showOnlyLogin !== whitebook.showOnlyLogin
5454
) {
5555
const link = inputType === 'link' ? link : uploadedPDFLink;
5656
formData.append('link', link);

components/common/image-upload.form.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Form, Image } from 'semantic-ui-react';
33
import { ImageUpload } from '@/utils/file-upload';
44

55
const ImageUploadForm = ({ type, uploadApiUri, originalImageUrl }) => {
6-
const [image_url, setImageUrl] = useState(originalImageUrl);
6+
const [imageUrl, setImageUrl] = useState(originalImageUrl);
77
const [isChanged, setIsChanged] = useState(false);
88

99
return (
@@ -27,7 +27,7 @@ const ImageUploadForm = ({ type, uploadApiUri, originalImageUrl }) => {
2727
<div style={{ margin: '10px 0' }}>
2828
<Image
2929
src={
30-
image_url ??
30+
imageUrl ??
3131
'https://react.semantic-ui.com/images/wireframe/image.png'
3232
}
3333
alt={'place_image'}

components/equipment/equipment.reservation.confirm.modal.jsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ const EquipmentReservationConfirmModal = (props) => {
88
const reservation = props.reservation;
99

1010
const [open, setOpen] = useState(false);
11-
const [send_email, setSendEmail] = useState(true);
11+
const [sendEmail, setSendEmail] = useState(true);
1212

1313
const handlePatch = async (e, data) => {
1414
try {
15-
const patch_type = data.name; // {accept, reject}
15+
const patchType = data.name; // {accept, reject}
1616
await PoPoAxios.patch(
17-
`/reservation-equip/${reservation.uuid}/status/${patch_type}?sendEmail=${send_email}`,
17+
`/reservation-equip/${reservation.uuid}/status/${patchType}?sendEmail=${sendEmail}`,
1818
{},
1919
);
2020
setOpen(false);
@@ -70,25 +70,25 @@ const EquipmentReservationConfirmModal = (props) => {
7070
<b>
7171
{moment(reservation.date, 'YYYYMMDD').format('YYYY-MM-DD')}
7272
&nbsp;
73-
{moment(reservation.start_time, 'HHmm').format('HH:mm')}
73+
{moment(reservation.startTime, 'HHmm').format('HH:mm')}
7474
&nbsp;~&nbsp;
75-
{moment(reservation.end_time, 'HHmm').format('HH:mm')}
75+
{moment(reservation.endTime, 'HHmm').format('HH:mm')}
7676
</b>
7777
</div>
7878
</Segment>
7979
<Segment>
8080
<h4>생성일</h4>
8181
<div>
82-
{moment(reservation.created_at).format('YYYY-MM-DD HH:mm')}
82+
{moment(reservation.createdAt).format('YYYY-MM-DD HH:mm')}
8383
</div>
8484
</Segment>
8585
</Segment.Group>
8686

8787
<Form style={{ marginBottom: '5rem' }}>
8888
<Form.Checkbox
8989
label={'승인 메일 보내기'}
90-
checked={send_email}
91-
onClick={() => setSendEmail(!send_email)}
90+
checked={sendEmail}
91+
onClick={() => setSendEmail(!sendEmail)}
9292
/>
9393
<Modal.Actions>
9494
<Button.Group floated={'left'}>

components/equipment/equipment.reservation.table.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ const EquipmentReservationTable = ({ reservations, startIdx }) => {
4545
'YYYY년 MM월 DD일',
4646
)}
4747
<br />
48-
{moment(reservation.start_time, 'HHmm').format('HH:mm')}
48+
{moment(reservation.startTime, 'HHmm').format('HH:mm')}
4949
&nbsp;~&nbsp;
50-
{moment(reservation.end_time, 'HHmm').format('HH:mm')}
50+
{moment(reservation.endTime, 'HHmm').format('HH:mm')}
5151
</b>
5252
</Table.Cell>
5353
<Table.Cell>{reservation.status}</Table.Cell>

0 commit comments

Comments
 (0)