Skip to content

Commit

Permalink
fix get dd by id
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesReate committed Nov 27, 2024
1 parent dc5ec48 commit b7b4ca1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/controllers/user_devices_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ func (udc *UserDevicesController) RegisterDeviceForUser(c *fiber.Ctx) error {

definitionId := reg.DefinitionId
if definitionId == "" {
req, err := http.NewRequest("GET", udc.Settings.DeviceDefinitionsGetByKSUIDEndpoint, nil)
req, err := http.NewRequest("GET", udc.Settings.DeviceDefinitionsGetByKSUIDEndpoint+*reg.DeviceDefinitionID, nil)
if err != nil {
return fiber.NewError(fiber.StatusInternalServerError, errors.Wrap(err, "failed to create request for get device definition").Error())
}
Expand All @@ -688,7 +688,7 @@ func (udc *UserDevicesController) RegisterDeviceForUser(c *fiber.Ctx) error {
definitionId = gjson.GetBytes(body, "nameSlug").String()

if definitionId == "" {
udc.log.Error().Msg("Failed to get device definition nameSlug from dd api response. request body: +" + string(body))
udc.log.Error().Msg("Failed to get device definition nameSlug from dd api response. response body: +" + string(body))
}
}

Expand Down

0 comments on commit b7b4ca1

Please sign in to comment.