테이블 타입관리 에러
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { Request, Response } from "express";
|
||||
import { Client } from "pg";
|
||||
import { logger } from "../utils/logger";
|
||||
import { AuthenticatedRequest } from "../types/auth";
|
||||
import { ApiResponse } from "../types/common";
|
||||
@@ -404,36 +405,25 @@ export async function updateColumnWebType(
|
||||
return;
|
||||
}
|
||||
|
||||
// PostgreSQL 클라이언트 생성
|
||||
const client = new Client({
|
||||
connectionString: process.env.DATABASE_URL,
|
||||
});
|
||||
const tableManagementService = new TableManagementService();
|
||||
await tableManagementService.updateColumnWebType(
|
||||
tableName,
|
||||
columnName,
|
||||
webType,
|
||||
detailSettings
|
||||
);
|
||||
|
||||
await client.connect();
|
||||
logger.info(
|
||||
`컬럼 웹 타입 설정 완료: ${tableName}.${columnName} = ${webType}`
|
||||
);
|
||||
|
||||
try {
|
||||
const tableManagementService = new TableManagementService(client);
|
||||
await tableManagementService.updateColumnWebType(
|
||||
tableName,
|
||||
columnName,
|
||||
webType,
|
||||
detailSettings
|
||||
);
|
||||
const response: ApiResponse<null> = {
|
||||
success: true,
|
||||
message: "컬럼 웹 타입이 성공적으로 설정되었습니다.",
|
||||
data: null,
|
||||
};
|
||||
|
||||
logger.info(
|
||||
`컬럼 웹 타입 설정 완료: ${tableName}.${columnName} = ${webType}`
|
||||
);
|
||||
|
||||
const response: ApiResponse<null> = {
|
||||
success: true,
|
||||
message: "컬럼 웹 타입이 성공적으로 설정되었습니다.",
|
||||
data: null,
|
||||
};
|
||||
|
||||
res.status(200).json(response);
|
||||
} finally {
|
||||
await client.end();
|
||||
}
|
||||
res.status(200).json(response);
|
||||
} catch (error) {
|
||||
logger.error("컬럼 웹 타입 설정 중 오류 발생:", error);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user