refactor: remove console logs and clean up fetch URL assignments in various components
This commit is contained in:
@@ -26,9 +26,7 @@
|
||||
credentials: 'include'
|
||||
});
|
||||
if (response.ok) {
|
||||
const data = await response.json();
|
||||
console.log('Countries data received:', data);
|
||||
console.log('First country sample:', data[0]);
|
||||
const data = await response.json();
|
||||
if (Array.isArray(data)) {
|
||||
countries = data;
|
||||
} else if (data.items && Array.isArray(data.items)) {
|
||||
@@ -37,8 +35,7 @@
|
||||
console.error('Unexpected data format:', data);
|
||||
countries = [];
|
||||
}
|
||||
filteredCountries = countries;
|
||||
console.log('Total countries loaded:', countries.length);
|
||||
filteredCountries = countries;
|
||||
} else {
|
||||
error = `Error: ${response.status} - ${response.statusText}`;
|
||||
console.error('Error response:', await response.text());
|
||||
|
||||
@@ -47,8 +47,7 @@
|
||||
});
|
||||
|
||||
if (response.ok) {
|
||||
const data = await response.json();
|
||||
console.log('Tariff fractions data received:', data);
|
||||
const data = await response.json();
|
||||
|
||||
if (data.items && Array.isArray(data.items)) {
|
||||
if (append) {
|
||||
@@ -58,8 +57,7 @@
|
||||
}
|
||||
currentPage = data.page;
|
||||
totalPages = data.pages;
|
||||
hasMore = currentPage < totalPages;
|
||||
console.log(`Loaded page ${currentPage}/${totalPages}, total items: ${fractions.length}`);
|
||||
hasMore = currentPage < totalPages;
|
||||
} else {
|
||||
console.error('Unexpected data format:', data);
|
||||
if (!append) fractions = [];
|
||||
|
||||
@@ -27,8 +27,7 @@
|
||||
credentials: 'include'
|
||||
});
|
||||
if (response.ok) {
|
||||
const data = await response.json();
|
||||
console.log('Units data received:', data);
|
||||
const data = await response.json();
|
||||
// El backend puede devolver { items: [...] } o directamente un array
|
||||
if (Array.isArray(data)) {
|
||||
units = data;
|
||||
|
||||
Reference in New Issue
Block a user