feat(platform): skip vehicle sections for unresolved lookup
This commit is contained in:
@@ -77,6 +77,28 @@ func (s *Service) VehicleDetail(ctx context.Context, vin string, protocol string
|
||||
if queryVIN == "" {
|
||||
queryVIN = keyword
|
||||
}
|
||||
if resolvedVIN == "" {
|
||||
qualityQuery := url.Values{"keyword": {keyword}, "limit": {"20"}}
|
||||
if protocol != "" {
|
||||
qualityQuery.Set("protocol", protocol)
|
||||
}
|
||||
quality, err := s.store.QualityIssues(ctx, qualityQuery)
|
||||
if err != nil {
|
||||
return VehicleDetail{}, err
|
||||
}
|
||||
return VehicleDetail{
|
||||
VIN: "",
|
||||
LookupKey: keyword,
|
||||
LookupResolved: false,
|
||||
Sources: []string{},
|
||||
SourceStatus: []VehicleSourceStatus{},
|
||||
Realtime: []RealtimeLocationRow{},
|
||||
History: Page[HistoryLocationRow]{Items: []HistoryLocationRow{}, Limit: 20, Offset: 0},
|
||||
Raw: Page[RawFrameRow]{Items: []RawFrameRow{}, Limit: 10, Offset: 0},
|
||||
Mileage: Page[DailyMileageRow]{Items: []DailyMileageRow{}, Limit: 20, Offset: 0},
|
||||
Quality: quality,
|
||||
}, nil
|
||||
}
|
||||
|
||||
realtimeQuery := url.Values{"vin": {queryVIN}, "limit": {"20"}}
|
||||
historyQuery := url.Values{"vin": {queryVIN}, "limit": {"20"}}
|
||||
|
||||
Reference in New Issue
Block a user