Initial commit
This commit is contained in:
@@ -41,12 +41,16 @@ export async function fetchBillboards(
|
||||
Authorization: token ? `Bearer ${token}` : "",
|
||||
},
|
||||
});
|
||||
} catch (error) {
|
||||
console.error("[fetchBillboards] fetch failed:", apiUrl, error);
|
||||
return { advertisings: [], totalItems: 0, totalPages: 0 };
|
||||
} finally {
|
||||
clearTimeout(timeoutId);
|
||||
}
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error("Network response was not ok");
|
||||
console.error("[fetchBillboards] bad response:", response.status, apiUrl);
|
||||
return { advertisings: [], totalItems: 0, totalPages: 0 };
|
||||
}
|
||||
|
||||
return response.json();
|
||||
|
||||
Reference in New Issue
Block a user