From df8c7db59b463aea2b464552e207e4ae63ea4077 Mon Sep 17 00:00:00 2001
From: joonhoekim <26rote@gmail.com>
Date: Tue, 21 Oct 2025 12:17:30 +0900
Subject: (김준회) 결재 조회 구조 변경, 권한없을 떄 권한 변경시 실패사유
 안내하도록 error.message 토스트에 추가
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 components/knox/approval/ApprovalList.tsx | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

(limited to 'components/knox/approval/ApprovalList.tsx')

diff --git a/components/knox/approval/ApprovalList.tsx b/components/knox/approval/ApprovalList.tsx
index ed26a375..ec47bf04 100644
--- a/components/knox/approval/ApprovalList.tsx
+++ b/components/knox/approval/ApprovalList.tsx
@@ -1,6 +1,6 @@
 'use client'
 
-import { useState, useEffect } from 'react';
+import { useState, useEffect, useCallback } from 'react';
 import { Button } from '@/components/ui/button';
 import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
 import { Badge } from '@/components/ui/badge';
@@ -62,7 +62,7 @@ export default function ApprovalList({
   const [error, setError] = useState<string | null>(null);
   const [isSyncing, setIsSyncing] = useState(false);
 
-  const fetchData = async () => {
+  const fetchData = useCallback(async () => {
     setIsLoading(true);
     setError(null);
 
@@ -106,7 +106,7 @@ export default function ApprovalList({
     } finally {
       setIsLoading(false);
     }
-  };
+  }, [type, userParams]);
 
   const getStatusBadgeVariant = (status: string) => {
     switch (status) {
@@ -189,7 +189,7 @@ export default function ApprovalList({
   // 컴포넌트 마운트 시 데이터 로드
   useEffect(() => {
     fetchData();
-  }, [type]);
+  }, [fetchData]);
 
   return (
     <Card className="w-full max-w-5xl">
-- 
cgit v1.2.3

