fix: usar Storage::url() como base para adjuntos en JS (compatible con producción)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-26 13:12:26 -06:00
parent aefe1760cb
commit 14048989a2
+2 -1
View File
@@ -86,6 +86,7 @@
<script>
const receiverId = {{ $user->id }};
const authId = {{ auth()->id() }};
const storageBase = '{{ rtrim(Storage::url(''), '/') }}';
const chatMessages = document.getElementById('chat-messages');
// scroll al fondo
@@ -118,7 +119,7 @@ document.getElementById('chat-form').addEventListener('submit', function(e) {
function buildAttachmentHtml(msg, isMine) {
if (!msg.attachment) return '';
const url = '/storage/' + msg.attachment;
const url = storageBase + '/' + msg.attachment;
const linkClass = isMine ? 'text-white' : 'text-dark';
switch (msg.attachment_type) {
case 'image':