fix(5): add authorization headers to search API calls
This commit is contained in:
@@ -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}`
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user