fix: 메뉴 목록의 순서 열을 빼고 가맹몰 위도·경도가 비어 보이던 것을 고친다
순서 열은 사용자 요청으로 뺀다(노출 순서 입력과 정렬은 그대로). 위도·경도는 백엔드가 숫자로 주는데 문자열만 읽어 늘 비어 있었다 — 숫자도 글자로 받는다. Co-Authored-By: Claude Fable 5.1
@15cb78fe71b073e18d1bebf928775329461ce852
--- app/(protected)/(basic)/system/merchant-details/_components/merchant-product-table.tsx
+++ app/(protected)/(basic)/system/merchant-details/_components/merchant-product-table.tsx
... | ... | @@ -58,7 +58,6 @@ |
| 58 | 58 |
<div className={styles.table}>
|
| 59 | 59 |
<FoxTable type="list" caption="메뉴 목록"> |
| 60 | 60 |
<FoxTableRow head> |
| 61 |
- <FoxTableCell head width={64} align="center">순서</FoxTableCell>
|
|
| 62 | 61 |
<FoxTableCell head width={140} align="center">이미지</FoxTableCell>
|
| 63 | 62 |
<FoxTableCell head width={240}>메뉴명</FoxTableCell>
|
| 64 | 63 |
<FoxTableCell head>설명</FoxTableCell> |
... | ... | @@ -70,16 +69,13 @@ |
| 70 | 69 |
|
| 71 | 70 |
{products.length === 0 ? (
|
| 72 | 71 |
<FoxTableRow> |
| 73 |
- <FoxTableCell colSpan={8} align="center">
|
|
| 72 |
+ <FoxTableCell colSpan={7} align="center">
|
|
| 74 | 73 |
등록된 메뉴가 없습니다. |
| 75 | 74 |
</FoxTableCell> |
| 76 | 75 |
</FoxTableRow> |
| 77 | 76 |
) : ( |
| 78 |
- products.map((product, index) => ( |
|
| 77 |
+ products.map((product) => ( |
|
| 79 | 78 |
<FoxTableRow key={product.id}>
|
| 80 |
- <FoxTableCell align="center" label="순서"> |
|
| 81 |
- {product.sortOrder ?? index + 1}
|
|
| 82 |
- </FoxTableCell> |
|
| 83 | 79 |
<FoxTableCell align="center" label="이미지"> |
| 84 | 80 |
<MerchantThumbnail src={product.imageUrl} alt={`${product.name} 이미지`} />
|
| 85 | 81 |
</FoxTableCell> |
--- lib/data/repositories/merchant-repository.ts
+++ lib/data/repositories/merchant-repository.ts
... | ... | @@ -55,6 +55,13 @@ |
| 55 | 55 |
return typeof value === 'string' ? value : ''; |
| 56 | 56 |
} |
| 57 | 57 |
|
| 58 |
+/** 숫자로 오는 값(위도·경도)도 글자로 받는다. */ |
|
| 59 |
+function readText(source: Record<string, unknown>, key: string): string {
|
|
| 60 |
+ const value = source[key]; |
|
| 61 |
+ if (typeof value === 'number' && Number.isFinite(value)) return String(value); |
|
| 62 |
+ return readString(source, key); |
|
| 63 |
+} |
|
| 64 |
+ |
|
| 58 | 65 |
function toMerchant(raw: unknown): Merchant[] {
|
| 59 | 66 |
if (!isRecord(raw)) {
|
| 60 | 67 |
return []; |
... | ... | @@ -83,8 +90,8 @@ |
| 83 | 90 |
address: readString(raw, 'frcsPostAddr'), |
| 84 | 91 |
addressDetail: readString(raw, 'frcsDaddr'), |
| 85 | 92 |
postalCode: readString(raw, 'frcsPostZip'), |
| 86 |
- latitude: readString(raw, 'lat'), |
|
| 87 |
- longitude: readString(raw, 'lng'), |
|
| 93 |
+ latitude: readText(raw, 'lat'), |
|
| 94 |
+ longitude: readText(raw, 'lng'), |
|
| 88 | 95 |
businessStatusCode: readString(raw, 'frcsBzstatCd').trim(), |
| 89 | 96 |
divisionCode: readString(raw, 'frcsDvCd').trim(), |
| 90 | 97 |
// 조회 SQL이 USE_YN을 select하지 않는다(⚠️ 5). 값이 없으면 판단하지 않는다 — |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?