타입에러 수정
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
import { Request, Response } from "express";
|
||||
import { Response } from "express";
|
||||
import { AuthenticatedRequest } from "../types/auth";
|
||||
import { pool } from "../database/db";
|
||||
import logger from "../utils/logger";
|
||||
|
||||
// 레이아웃 목록 조회
|
||||
export const getLayouts = async (
|
||||
req: Request,
|
||||
req: AuthenticatedRequest,
|
||||
res: Response
|
||||
): Promise<Response> => {
|
||||
try {
|
||||
@@ -67,7 +68,7 @@ export const getLayouts = async (
|
||||
|
||||
// 레이아웃 상세 조회 (객체 포함)
|
||||
export const getLayoutById = async (
|
||||
req: Request,
|
||||
req: AuthenticatedRequest,
|
||||
res: Response
|
||||
): Promise<Response> => {
|
||||
try {
|
||||
@@ -125,7 +126,7 @@ export const getLayoutById = async (
|
||||
|
||||
// 레이아웃 생성
|
||||
export const createLayout = async (
|
||||
req: Request,
|
||||
req: AuthenticatedRequest,
|
||||
res: Response
|
||||
): Promise<Response> => {
|
||||
const client = await pool.connect();
|
||||
@@ -237,7 +238,7 @@ export const createLayout = async (
|
||||
|
||||
// 레이아웃 수정
|
||||
export const updateLayout = async (
|
||||
req: Request,
|
||||
req: AuthenticatedRequest,
|
||||
res: Response
|
||||
): Promise<Response> => {
|
||||
const client = await pool.connect();
|
||||
@@ -407,7 +408,7 @@ export const updateLayout = async (
|
||||
|
||||
// 레이아웃 삭제
|
||||
export const deleteLayout = async (
|
||||
req: Request,
|
||||
req: AuthenticatedRequest,
|
||||
res: Response
|
||||
): Promise<Response> => {
|
||||
try {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { Request, Response } from "express";
|
||||
import { Response } from "express";
|
||||
import { AuthenticatedRequest } from "../types/auth";
|
||||
import { getPool } from "../database/db";
|
||||
import { logger } from "../utils/logger";
|
||||
|
||||
@@ -6,7 +7,7 @@ import { logger } from "../utils/logger";
|
||||
* 엔티티 검색 API
|
||||
* GET /api/entity-search/:tableName
|
||||
*/
|
||||
export async function searchEntity(req: Request, res: Response) {
|
||||
export async function searchEntity(req: AuthenticatedRequest, res: Response) {
|
||||
try {
|
||||
const { tableName } = req.params;
|
||||
const {
|
||||
@@ -22,7 +23,8 @@ export async function searchEntity(req: Request, res: Response) {
|
||||
logger.warn("엔티티 검색 실패: 테이블명이 없음", { tableName });
|
||||
return res.status(400).json({
|
||||
success: false,
|
||||
message: "테이블명이 지정되지 않았습니다. 컴포넌트 설정에서 sourceTable을 확인해주세요.",
|
||||
message:
|
||||
"테이블명이 지정되지 않았습니다. 컴포넌트 설정에서 sourceTable을 확인해주세요.",
|
||||
});
|
||||
}
|
||||
|
||||
@@ -111,8 +113,10 @@ export async function searchEntity(req: Request, res: Response) {
|
||||
},
|
||||
});
|
||||
} catch (error: any) {
|
||||
logger.error("엔티티 검색 오류", { error: error.message, stack: error.stack });
|
||||
logger.error("엔티티 검색 오류", {
|
||||
error: error.message,
|
||||
stack: error.stack,
|
||||
});
|
||||
res.status(500).json({ success: false, message: error.message });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { Request, Response } from "express";
|
||||
import { Response } from "express";
|
||||
import { AuthenticatedRequest } from "../types/auth";
|
||||
import { getPool } from "../database/db";
|
||||
import { logger } from "../utils/logger";
|
||||
|
||||
@@ -35,7 +36,7 @@ async function generateOrderNumber(companyCode: string): Promise<string> {
|
||||
* 수주 등록 API
|
||||
* POST /api/orders
|
||||
*/
|
||||
export async function createOrder(req: Request, res: Response) {
|
||||
export async function createOrder(req: AuthenticatedRequest, res: Response) {
|
||||
const pool = getPool();
|
||||
|
||||
try {
|
||||
@@ -167,7 +168,7 @@ export async function createOrder(req: Request, res: Response) {
|
||||
* 수주 목록 조회 API
|
||||
* GET /api/orders
|
||||
*/
|
||||
export async function getOrders(req: Request, res: Response) {
|
||||
export async function getOrders(req: AuthenticatedRequest, res: Response) {
|
||||
const pool = getPool();
|
||||
|
||||
try {
|
||||
@@ -235,4 +236,3 @@ export async function getOrders(req: Request, res: Response) {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user