Bug update function

This commit is contained in:
NW
2024-12-14 23:12:36 +00:00
parent 682246675e
commit 9d9e0e80ad
9 changed files with 474 additions and 201 deletions

View File

@@ -27,10 +27,16 @@ class LocationService {
}
static async getLocationById(locationId) {
return await db.getAsync(
'SELECT country, city, district FROM locations WHERE id = ?',
[locationId]
);
try {
const location = await db.getAsync(
'SELECT * FROM locations WHERE id = ?',
[locationId]
);
return location;
} catch (error) {
console.error('Error fetching location by ID:', error);
throw new Error('Failed to fetch location');
}
}
}