From fdca5b008b9f3e3eccd519e8c7925fdb87079f58 Mon Sep 17 00:00:00 2001 From: roschaefer Date: Fri, 6 Dec 2019 02:12:47 +0100 Subject: [PATCH] Return empty array instead null for "not reviewed" @mattwr18 why did you add the null check in th resolver? --- backend/src/schema/resolvers/reports.js | 1 - .../features/ReportList/ReportList.story.js | 2 +- webapp/components/features/ReportRow/ReportRow.vue | 11 ++++++++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/backend/src/schema/resolvers/reports.js b/backend/src/schema/resolvers/reports.js index 2b2cabd50..350d86d20 100644 --- a/backend/src/schema/resolvers/reports.js +++ b/backend/src/schema/resolvers/reports.js @@ -144,7 +144,6 @@ export default { }) try { const txResult = await readTxPromise - if (!txResult[0]) return null reviewed = txResult.map(reportedRecord => { const { review, moderator } = reportedRecord const relationshipWithNestedAttributes = { diff --git a/webapp/components/features/ReportList/ReportList.story.js b/webapp/components/features/ReportList/ReportList.story.js index e126f1e64..e651c4462 100644 --- a/webapp/components/features/ReportList/ReportList.story.js +++ b/webapp/components/features/ReportList/ReportList.story.js @@ -101,7 +101,7 @@ export const reports = [ slug: 'bigoted-post', title: "I'm a bigoted post!", }, - reviewed: null, + reviewed: [], }, { __typename: 'Report', diff --git a/webapp/components/features/ReportRow/ReportRow.vue b/webapp/components/features/ReportRow/ReportRow.vue index cc81ae018..6dce9c317 100644 --- a/webapp/components/features/ReportRow/ReportRow.vue +++ b/webapp/components/features/ReportRow/ReportRow.vue @@ -40,7 +40,7 @@ {{ statusText }} - +