Skip to content

Commit 6d5e6f5

Browse files
committed
Fix output
1 parent 3b20476 commit 6d5e6f5

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

command/ota/status.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ func printOut(res any, wideOutput bool) {
4848
}
4949
}
5050
if outputformat == feedback.Text {
51-
if st, ok := res.(*otaapi.OtaStatusResponse); ok {
51+
if st, ok := res.(*otaapi.OtaStatusPrint); ok {
5252
fmt.Println(st.Ota.ToText())
5353
fmt.Println()
5454
fmt.Println("Details:")
55-
for i := range st.States {
56-
fmt.Println(st.States[i].ToText())
55+
for i := range st.Details {
56+
fmt.Println(st.Details[i].ToText())
5757
}
5858
}
5959
if st, ok := res.([]otaapi.Ota); ok {

internal/ota-api/client.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,10 @@ func (c *OtaApiClient) GetOtaStatusByDeviceID(deviceID string) (*OtaStatusByDevi
149149
}
150150
return t1.After(t2)
151151
})
152-
} else if res.StatusCode == 404 || res.StatusCode == 400 {
153-
return nil, fmt.Errorf("device-id %s not found", deviceID)
154152
}
155-
156153
return &otaResponse, nil
154+
} else if res.StatusCode == 404 || res.StatusCode == 400 {
155+
return nil, fmt.Errorf("device-id %s not found", deviceID)
157156
}
158157

159158
return nil, err

0 commit comments

Comments
 (0)