B:BD[
2.11108] → [
2.11108:11445]
// Fetch location info
const locationResponse = await fetch(`/api/locations/${locationId}`, {
headers: { Authorization: `Bearer ${accessToken}` },
});
if (locationResponse.ok) {
const locationData = await locationResponse.json();
setLocationName(locationData.name);
// Use location name from state if available, otherwise fetch it
if (state?.locationName) {
setLocationName(state.locationName);
} else {
const locationResponse = await fetch(`/api/locations/${locationId}`, {
headers: { Authorization: `Bearer ${accessToken}` },
});
if (locationResponse.ok) {
const locationData = await locationResponse.json();
setLocationName(locationData.name);
}