feat: 입력 타입 처리 개선 및 변환 로직 추가

- 입력 타입이 "direct" 또는 "auto"일 경우, 이를 "text"로 변환하는 로직을 추가하여 데이터베이스에 잘못된 값이 저장되지 않도록 하였습니다.
- 관련된 경고 로그를 추가하여 잘못된 입력 타입 감지를 강화하였습니다.
- 웹 타입 변환 시에도 동일한 로직을 적용하여 일관성을 유지하였습니다.
- 프론트엔드에서 입력 타입 변경 시 로컬 상태만 업데이트하도록 수정하여 데이터베이스에 저장하지 않도록 하였습니다.
This commit is contained in:
DDD1542
2026-02-02 12:07:37 +09:00
parent 51492a8911
commit 50ee165c37
4 changed files with 62 additions and 37 deletions

View File

@@ -174,30 +174,10 @@ export default function TableTypeSelector({
}
};
// 입력 타입 변경
const handleInputTypeChange = async (columnName: string, inputType: "direct" | "auto") => {
try {
// 현재 컬럼 정보 가져오기
const currentColumn = columns.find((col) => col.columnName === columnName);
if (!currentColumn) return;
// 웹 타입과 함께 입력 타입 업데이트
await tableTypeApi.setColumnWebType(
selectedTable,
columnName,
currentColumn.webType || "text",
undefined, // detailSettings
inputType,
);
// 로컬 상태 업데이트
setColumns((prev) => prev.map((col) => (col.columnName === columnName ? { ...col, inputType } : col)));
// console.log(`컬럼 ${columnName}의 입력 타입을 ${inputType}로 변경했습니다.`);
} catch (error) {
// console.error("입력 타입 변경 실패:", error);
alert("입력 타입 설정에 실패했습니다. 다시 시도해주세요.");
}
// 입력 타입 변경 (로컬 상태만 - DB에 저장하지 않음)
const handleInputTypeChange = (columnName: string, inputType: "direct" | "auto") => {
// 로컬 상태만 업데이트 (DB에는 저장하지 않음 - inputType은 화면 렌더링용)
setColumns((prev) => prev.map((col) => (col.columnName === columnName ? { ...col, inputType } : col)));
};
const filteredTables = tables.filter((table) => table.displayName.toLowerCase().includes(searchTerm.toLowerCase()));