Skip to content

Commit 673f2c5

Browse files
committed
fix(swagger): model swapped between afk_enabled endpoints
1 parent 027621d commit 673f2c5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

internal/api/router/manager.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,10 @@ func (m *Manager) ListenAndServe(ctx context.Context, address string, port int,
8282
mux.HandleFunc("GET /v1/devices/{hostname}/config", withAuth.Wrap(m.getDeviceConfig))
8383

8484
api.Get("/v1/devices/*/afk_enabled").
85-
HasResponseModel(http.StatusOK, rest.ModelOf[device.AFKEnabledResponse]()).
85+
HasResponseModel(http.StatusOK, rest.ModelOf[map[string]device.AFKEnabledResponse]()).
8686
HasTags([]string{"devices"}).HasDescription("Give all devices that should run AFK")
8787
api.Get("/v1/devices/{hostname}/afk_enabled").
88-
HasResponseModel(http.StatusOK, rest.ModelOf[map[string]device.AFKEnabledResponse]()).
88+
HasResponseModel(http.StatusOK, rest.ModelOf[device.AFKEnabledResponse]()).
8989
HasPathParameter("hostname", rest.PathParam{Description: "Device hostname", Type: rest.PrimitiveTypeString}).
9090
HasTags([]string{"devices"}).HasDescription("Tells if a device should run AFK")
9191

0 commit comments

Comments
 (0)