api/v2: register device update operations apart

registerDevices passed gocyclo's limit.

Updates #3629
This commit is contained in:
Kristoffer Dalby committed 2026-11-05 15:51:04 +01:00
1 parent 49ddd3d412
commit ac25916b5f
1 file changed
+5 -1
+5 -1
View File
@@ -20,7 +20,7 @@ import (
) )
func init() { func init() {
registrations = append(registrations, registerDevices) registrations = append(registrations, registerDevices, registerDeviceUpdates)
} }
// Device is the Tailscale device response. Headscale nodes map onto it; fields // Device is the Tailscale device response. Headscale nodes map onto it; fields
@@ -503,6 +503,10 @@ func registerDevices(api huma.API, b Backend) {
return &deviceRoutesOutput{Body: routesFromView(node)}, nil return &deviceRoutesOutput{Body: routesFromView(node)}, nil
}) })
}
func registerDeviceUpdates(api huma.API, b Backend) {
deviceTags := []string{"Devices", tagTailscaleCompat}
huma.Register(api, requireScope(huma.Operation{ huma.Register(api, requireScope(huma.Operation{
OperationID: "updateDeviceClient", OperationID: "updateDeviceClient",