diff --git a/public/sounds/default.wav b/public/sounds/default.wav index 59238b1b..e69de29b 100644 Binary files a/public/sounds/default.wav and b/public/sounds/default.wav differ diff --git a/public/sounds/push_notification.wav b/public/sounds/push_notification.wav index 59238b1b..e69de29b 100644 Binary files a/public/sounds/push_notification.wav and b/public/sounds/push_notification.wav differ diff --git a/public/sounds/sam_voice.wav b/public/sounds/sam_voice.wav deleted file mode 100644 index 59238b1b..00000000 Binary files a/public/sounds/sam_voice.wav and /dev/null differ diff --git a/src/components/settings/NotificationSettings/index.tsx b/src/components/settings/NotificationSettings/index.tsx index e4d0ba9d..4aaa7739 100644 --- a/src/components/settings/NotificationSettings/index.tsx +++ b/src/components/settings/NotificationSettings/index.tsx @@ -29,26 +29,13 @@ import { saveNotificationSettings } from './actions'; import { ItemSettingsDialog } from './ItemSettingsDialog'; // 미리듣기 함수 -let previewAudio: HTMLAudioElement | null = null; - function playPreviewSound(soundType: SoundType) { if (soundType === 'mute') { toast.info('무음으로 설정되어 있습니다.'); return; } - - // 이전 재생 중지 - if (previewAudio) { - previewAudio.pause(); - previewAudio = null; - } - - const soundFile = soundType === 'sam_voice' ? 'sam_voice.wav' : 'default.wav'; - previewAudio = new Audio(`/sounds/${soundFile}`); - previewAudio.play().catch(() => { - const soundName = soundType === 'default' ? '기본 알림음' : 'SAM 보이스'; - toast.info(`${soundName} 미리듣기`); - }); + const soundName = soundType === 'default' ? '기본 알림음' : 'SAM 보이스'; + toast.info(`${soundName} 미리듣기`); } // 알림 항목 컴포넌트 diff --git a/src/components/settings/NotificationSettings/types.ts b/src/components/settings/NotificationSettings/types.ts index c5290b53..b9b878e6 100644 --- a/src/components/settings/NotificationSettings/types.ts +++ b/src/components/settings/NotificationSettings/types.ts @@ -1,12 +1,33 @@ /** * 알림 설정 타입 정의 * - * API 응답 구조: { enabled, email, soundType } per item - * soundType: 'default' | 'sam_voice' | 'mute' + * ======================================== + * [2026-01-05] 백엔드 API 수정 필요 사항 + * ======================================== * - * [2026-03-18] soundType API 연동 완료 - * - API가 settings JSON 컬럼의 sound_type 키로 저장/반환 - * - 음원 파일: public/sounds/default.wav, sam_voice.wav + * 1. NotificationItem에 soundType 필드 추가 + * - 기존: { enabled: boolean, email: boolean } + * - 변경: { enabled: boolean, email: boolean, soundType: 'default' | 'sam_voice' | 'mute' } + * + * 2. OrderNotificationSettings에 approvalRequest 항목 추가 + * - 기존: { salesOrder, purchaseOrder } + * - 변경: { salesOrder, purchaseOrder, approvalRequest } + * + * 3. API 응답 예시: + * { + * "notice": { + * "enabled": true, + * "notice": { "enabled": true, "email": false, "soundType": "default" }, + * "event": { "enabled": true, "email": true, "soundType": "sam_voice" } + * }, + * "order": { + * "enabled": true, + * "salesOrder": { ... }, + * "purchaseOrder": { ... }, + * "approvalRequest": { "enabled": false, "email": false, "soundType": "default" } // 새로 추가 + * } + * } + * ======================================== */ // 알림 소리 타입 (NEW: 2026-01-05)