mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
add station info api
This commit is contained in:
parent
a281fe6d65
commit
38427429dd
1 changed files with 18 additions and 2 deletions
|
@ -118,9 +118,25 @@ watch(
|
|||
},
|
||||
);
|
||||
|
||||
const stationInfo = ref({});
|
||||
const stationInfo = ref({
|
||||
callsign: 'N/A', // Default value for callsign
|
||||
location: {
|
||||
gridsquare: 'N/A', // Default value for gridsquare
|
||||
},
|
||||
});
|
||||
|
||||
async function getStationInfoByCallsign(){
|
||||
stationInfo.value = await getStationInfo(chat.selectedCallsign);
|
||||
try {
|
||||
const data = await getStationInfo(chat.selectedCallsign);
|
||||
stationInfo.value = {
|
||||
callsign: data.callsign || 'N/A', // Default if not present
|
||||
location: {
|
||||
gridsquare: data.location?.gridsquare || 'N/A', // Default if not present
|
||||
},
|
||||
};
|
||||
} catch (error) {
|
||||
console.error("Error fetching station info:", error);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue