From b04b30f076b2914d98be0725ce8696cbb5c20c3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=B3=B4=EA=B3=A4?= Date: Thu, 5 Mar 2026 14:48:04 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20[rd]=20CM=EC=86=A1=20=EC=A0=80=EC=9E=A5?= =?UTF-8?q?=20=EC=8B=9C=20tenant=5Fid=EB=A5=BC=20session=EC=97=90=EC=84=9C?= =?UTF-8?q?=20=EA=B0=80=EC=A0=B8=EC=98=A4=EB=8F=84=EB=A1=9D=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/Rd/CmSongController.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/Http/Controllers/Rd/CmSongController.php b/app/Http/Controllers/Rd/CmSongController.php index 6c5bb335..99045b43 100644 --- a/app/Http/Controllers/Rd/CmSongController.php +++ b/app/Http/Controllers/Rd/CmSongController.php @@ -202,7 +202,8 @@ public function store(Request $request): JsonResponse 'audio_mime_type' => 'nullable|string', ]); - $user = Auth::user(); + $tenantId = session('selected_tenant_id', 1); + $userId = Auth::id(); $audioPath = null; // 오디오 데이터가 있으면 WAV 파일로 저장 @@ -219,15 +220,15 @@ public function store(Request $request): JsonResponse } $filename = 'cm-song-'.date('Ymd-His').'-'.uniqid().'.wav'; - $dir = "cm-songs/{$user->tenant_id}"; + $dir = "cm-songs/{$tenantId}"; Storage::disk('tenant')->makeDirectory($dir); Storage::disk('tenant')->put("{$dir}/{$filename}", $audioBytes); $audioPath = "{$dir}/{$filename}"; } $song = CmSong::create([ - 'tenant_id' => $user->tenant_id, - 'user_id' => $user->id, + 'tenant_id' => $tenantId, + 'user_id' => $userId, 'company_name' => $request->company_name, 'industry' => $request->industry, 'lyrics' => $request->lyrics,