Update machine-api for modified api schema (#3572)

update to new machine-api format
This commit is contained in:
Paul Tagliamonte
2024-08-28 15:15:37 -04:00
committed by GitHub
parent 5e8227ead8
commit 1162ff3b03
7 changed files with 197 additions and 2880 deletions

View File

@ -26,15 +26,7 @@ export async function exportMake(data: ArrayBuffer): Promise<Response | null> {
return null
}
let machineId = null
if ('id' in currentMachine) {
machineId = currentMachine.id
} else if ('hostname' in currentMachine && currentMachine.hostname) {
machineId = currentMachine.hostname
} else if ('ip' in currentMachine && currentMachine.ip) {
machineId = currentMachine.ip
}
let machineId = currentMachine?.id
if (!machineId) {
console.error('No machine id available', currentMachine)
toast.error('No machine id available')