From fa3198205009a265e68852e0a1c08b5d05f071cc Mon Sep 17 00:00:00 2001 From: Vasco Santos Date: Mon, 15 Nov 2021 20:14:35 +0100 Subject: [PATCH] fix: pin status metrics returns data object --- packages/db/postgres/metrics.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/db/postgres/metrics.js b/packages/db/postgres/metrics.js index 2519006217..1862c3545b 100644 --- a/packages/db/postgres/metrics.js +++ b/packages/db/postgres/metrics.js @@ -76,13 +76,13 @@ const pinStatusMapping = { export async function getPinStatusMetrics (client, key) { const pinStatus = pinStatusMapping[key] - const { count, error } = await client.rpc('pin_from_status_total', { query_status: pinStatus }) + const { data, error } = await client.rpc('pin_from_status_total', { query_status: pinStatus }) if (error) { throw new DBError(error) } return { - total: count + total: data[0].pin_from_status_total } }