Migrate ingest and API paths to string IDs
This commit is contained in:
@@ -47,14 +47,14 @@ func (h ingestHandlers) handleLogBundle(w http.ResponseWriter, r *http.Request)
|
||||
}
|
||||
|
||||
var req struct {
|
||||
AssetID int64 `json:"asset_id"`
|
||||
AssetID string `json:"asset_id"`
|
||||
CollectedAt string `json:"collected_at"`
|
||||
Source *string `json:"source"`
|
||||
Components []struct {
|
||||
VendorSerial string `json:"vendor_serial"`
|
||||
Vendor *string `json:"vendor"`
|
||||
Model *string `json:"model"`
|
||||
LotID *int64 `json:"lot_id"`
|
||||
LotID *string `json:"lot_id"`
|
||||
Firmware *string `json:"firmware_version"`
|
||||
} `json:"components"`
|
||||
}
|
||||
@@ -64,7 +64,7 @@ func (h ingestHandlers) handleLogBundle(w http.ResponseWriter, r *http.Request)
|
||||
return
|
||||
}
|
||||
|
||||
if req.AssetID <= 0 {
|
||||
if strings.TrimSpace(req.AssetID) == "" {
|
||||
writeError(w, http.StatusBadRequest, "asset_id is required")
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user