Skip to content

Commit 49ad4eb

Browse files
committed
refactor: rename inventory device handler
1 parent 274c614 commit 49ad4eb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

services/inventory/server/server.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ func NewServer(cfg Config) (*Server, error) {
9696
r.Route("/devices", func(r chi.Router) {
9797
r.Get("/", s.listDevices)
9898
r.Post("/", s.registerDevice)
99-
r.Get("/{deviceID}", s.getDeviceHandler)
99+
r.Get("/{deviceID}", s.deviceDetails)
100100
r.Put("/{deviceID}", s.updateDevice)
101101
r.Post("/{deviceID}/posture", s.updateDevicePosture)
102102
})
@@ -295,7 +295,7 @@ func (s *Server) registerDevice(w http.ResponseWriter, r *http.Request) {
295295
}
296296
}
297297

298-
func (s *Server) getDeviceHandler(w http.ResponseWriter, r *http.Request) {
298+
func (s *Server) deviceDetails(w http.ResponseWriter, r *http.Request) {
299299
id := chi.URLParam(r, deviceIDParam)
300300
var d Device
301301
if err := s.db.QueryRow(`SELECT id, public_key, posture, registered_at, last_updated FROM devices WHERE id=$1`, id).Scan(&d.ID, &d.PublicKey, &d.Posture, &d.Registered, &d.LastUpdated); err != nil {

0 commit comments

Comments
 (0)