mirror of
https://github.com/juanfont/headscale.git
synced 2026-11-20 04:14:32 +09:00
api/v2: register device update operations apart
registerDevices passed gocyclo's limit. Updates #3629
This commit is contained in:
1 parent
49ddd3d412
commit
ac25916b5f
1 file changed
+5
-1
@@ -20,7 +20,7 @@ import (
|
||||
)
|
||||
|
||||
func init() {
|
||||
registrations = append(registrations, registerDevices)
|
||||
registrations = append(registrations, registerDevices, registerDeviceUpdates)
|
||||
}
|
||||
|
||||
// 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
|
||||
})
|
||||
}
|
||||
|
||||
func registerDeviceUpdates(api huma.API, b Backend) {
|
||||
deviceTags := []string{"Devices", tagTailscaleCompat}
|
||||
|
||||
huma.Register(api, requireScope(huma.Operation{
|
||||
OperationID: "updateDeviceClient",
|
||||
|
||||
Reference in new issue
Block a user