Skip to content

Commit

Permalink
Only change resourceId when multiple timeseries are returned
Browse files Browse the repository at this point in the history
  • Loading branch information
wkramer committed Jan 31, 2024
1 parent 81ee5f5 commit 165c97f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/services/useTimeSeries/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,10 @@ export function useTimeSeries(
if (piSeries.timeSeries !== undefined)
for (const index in piSeries.timeSeries) {
const timeSeries = piSeries.timeSeries[index]
const resourceId = `${request.key}[${index}]`
const resourceId =
piSeries.timeSeries.length > 1
? `${request.key}[${index}]`
: request.key ?? ''
updatedSeriesIds.push(resourceId)
if (timeSeries.events === undefined) continue
const resource = new SeriesUrlRequest('fews-pi', 'dummyUrl')
Expand Down

0 comments on commit 165c97f

Please sign in to comment.