diff --git a/src/datasources/tag/TagDataSource.test.ts b/src/datasources/tag/TagDataSource.test.ts index 3483bcc..22201ce 100644 --- a/src/datasources/tag/TagDataSource.test.ts +++ b/src/datasources/tag/TagDataSource.test.ts @@ -198,7 +198,7 @@ describe('queries', () => { }); test('filters by workspace if provided', async () => { - backendSrv.fetch.mockReturnValueOnce(createQueryTagsResponse({ workspace_id: '2' })); + backendSrv.fetch.mockReturnValueOnce(createQueryTagsResponse({ workspace: '2' })); backendSrv.fetch.mockReturnValueOnce(createTagHistoryResponse('my.tag', 'DOUBLE', [])); await ds.query(buildQuery({ type: TagQueryType.History, path: 'my.tag', workspace: '2' })); @@ -259,7 +259,7 @@ function createQueryTagsResponse( { tag, current }, { current: { value: { value: '3.14' }, timestamp: '2023-10-04T00:00:00.000000Z' }, - tag: { datatype: 'DOUBLE', path: 'my.tag', properties: {}, workspace_id: '1' }, + tag: { datatype: 'DOUBLE', path: 'my.tag', properties: {}, workspace: '1' }, } ), ], diff --git a/src/datasources/tag/TagDataSource.ts b/src/datasources/tag/TagDataSource.ts index 1af276e..6c5aad3 100644 --- a/src/datasources/tag/TagDataSource.ts +++ b/src/datasources/tag/TagDataSource.ts @@ -46,7 +46,7 @@ export class TagDataSource extends DataSourceBase { { name: 'updated', values: [current?.timestamp], type: FieldType.time, config: { unit: 'dateTimeFromNow' } }, ]; } else { - const history = await this.getTagHistoryValues(tag.path, tag.workspace_id, range, maxDataPoints); + const history = await this.getTagHistoryValues(tag.path, tag.workspace, range, maxDataPoints); result.fields = [ { name: 'time', values: history.datetimes }, { name, values: history.values }, diff --git a/src/datasources/tag/types.ts b/src/datasources/tag/types.ts index 30dd7c6..4d4a5f2 100644 --- a/src/datasources/tag/types.ts +++ b/src/datasources/tag/types.ts @@ -21,7 +21,7 @@ export interface TagWithValue { datatype: string; path: string; properties: Record | null; - workspace_id: string; + workspace: string; }; }