Bug update function
This commit is contained in:
@@ -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');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user