client/web: add initial framework for exit node selector

Updates tailscale/corp#14335

Signed-off-by: Sonia Appasamy <sonia@tailscale.com>
This commit is contained in:
Sonia Appasamy
2023-11-07 11:16:23 -05:00
committed by Sonia Appasamy
parent de2af54ffc
commit 5e095ddc20
8 changed files with 202 additions and 34 deletions

View File

@ -75,7 +75,7 @@ export default function useNodeData() {
: data.AdvertiseExitNode,
}
apiFetch("/data", "POST", update, { up: "true" })
return apiFetch("/data", "POST", update, { up: "true" })
.then((r) => r.json())
.then((r) => {
setIsPosting(false)
@ -89,7 +89,10 @@ export default function useNodeData() {
}
refreshData()
})
.catch((err) => alert("Failed operation: " + err.message))
.catch((err) => {
alert("Failed operation: " + err.message)
throw err
})
},
[data]
)