diff options
| author | joonhoekim <26rote@gmail.com> | 2025-10-21 12:17:30 +0900 |
|---|---|---|
| committer | joonhoekim <26rote@gmail.com> | 2025-10-21 12:17:30 +0900 |
| commit | df8c7db59b463aea2b464552e207e4ae63ea4077 (patch) | |
| tree | c15cfb7f44a433996c8a46f4511d43550bd4c50d /components | |
| parent | 52b0f03803a94689ccc08578b5538405c88be1f2 (diff) | |
(김준회) 결재 조회 구조 변경, 권한없을 떄 권한 변경시 실패사유 안내하도록 error.message 토스트에 추가
Diffstat (limited to 'components')
| -rw-r--r-- | components/knox/approval/ApprovalList.tsx | 8 | ||||
| -rw-r--r-- | components/permissions/menu-permission-generator.tsx | 2 |
2 files changed, 5 insertions, 5 deletions
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"> diff --git a/components/permissions/menu-permission-generator.tsx b/components/permissions/menu-permission-generator.tsx index 4c8d60d0..0aa05d5a 100644 --- a/components/permissions/menu-permission-generator.tsx +++ b/components/permissions/menu-permission-generator.tsx @@ -168,7 +168,7 @@ export function MenuBasedPermissionGenerator() { toast.success(`${result.created}개의 권한이 생성되었습니다.`); loadAnalysis(); } catch (error) { - toast.error("권한 생성에 실패했습니다."); + toast.error(`권한 생성에 실패했습니다. ${error instanceof Error ? error.message : ''}`); } finally { setGenerating(false); } |
