From cb0d464fafc87cab9c27f6e339377eae017cb748 Mon Sep 17 00:00:00 2001 From: Max Cao Date: Mon, 22 Aug 2022 20:32:47 -0400 Subject: [PATCH] fixed issues with new graphql schema for querying archived recordings --- src/app/RecordingMetadata/BulkEditLabels.tsx | 16 ++++++++++------ src/app/Shared/Services/Api.service.tsx | 8 +++++--- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/app/RecordingMetadata/BulkEditLabels.tsx b/src/app/RecordingMetadata/BulkEditLabels.tsx index ae5811ce4..2d20384d9 100644 --- a/src/app/RecordingMetadata/BulkEditLabels.tsx +++ b/src/app/RecordingMetadata/BulkEditLabels.tsx @@ -106,6 +106,8 @@ export const BulkEditLabels: React.FunctionComponent = (pro const updateCommonLabels = React.useCallback( (setLabels: (l: RecordingLabel[]) => void) => { let allRecordingLabels = [] as RecordingLabel[][]; + console.log("updateCommonLabels", recordings); + console.log(recordings) recordings.forEach((r: ArchivedRecording, idx) => { if (props.checkedIndices.includes(idx)) { allRecordingLabels.push(parseLabels(r.metadata.labels)); @@ -135,18 +137,20 @@ export const BulkEditLabels: React.FunctionComponent = (pro targetNodes(filter: { name: "${target.connectUrl}" }) { recordings { archived { - name - downloadUrl - reportUrl - metadata { - labels + data { + name + downloadUrl + reportUrl + metadata { + labels + } } } } } }`), ), - map(v => props.isTargetRecording ? v : v.data.targetNodes[0].recordings.archived as ArchivedRecording[]), + map(v => props.isTargetRecording ? v : v.data.targetNodes[0].recordings.archived.data as ArchivedRecording[]), first() ) .subscribe((value) => setRecordings(value)) diff --git a/src/app/Shared/Services/Api.service.tsx b/src/app/Shared/Services/Api.service.tsx index d178e5122..9a86a5559 100644 --- a/src/app/Shared/Services/Api.service.tsx +++ b/src/app/Shared/Services/Api.service.tsx @@ -544,9 +544,11 @@ export class ApiService { targetNodes(filter: { name: "${target.connectUrl}" }) { recordings { archived(filter: { name: "${recordingName}" }) { - doPutMetadata(metadata: { labels: ${this.stringifyRecordingLabels(labels)}}) { - metadata { - labels + data { + doPutMetadata(metadata: { labels: ${this.stringifyRecordingLabels(labels)}}) { + metadata { + labels + } } } }