fix(5): add authorization headers to search API calls

This commit is contained in:
2026-04-22 18:04:47 +03:00
parent 7bb92d3bd9
commit 0c0c519274

View File

@@ -49,10 +49,12 @@ export default function SearchModal({
try {
const backendUrl = process.env.NEXT_PUBLIC_BACKEND_URL || 'http://localhost:8906';
const token = localStorage.getItem('auth_token');
const response = await fetch(`${backendUrl}/items/search?q=${encodeURIComponent(searchQuery)}`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${token}`
},
});