refactor: remove console logs and clean up fetch URL assignments in various components

This commit is contained in:
2026-02-13 16:30:18 -06:00
parent e05e50f2b8
commit 472e42a02f
14 changed files with 11 additions and 40 deletions

View File

@@ -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());

View File

@@ -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 = [];

View File

@@ -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;