From b72c4fdbb4acac7f22a4aee5b3911a68e28ee9f6 Mon Sep 17 00:00:00 2001 From: rijkvanzanten Date: Thu, 17 Jun 2021 16:42:12 -0400 Subject: [PATCH] Use updated aggregate function type signature --- app/src/panels/metric/metric.vue | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/app/src/panels/metric/metric.vue b/app/src/panels/metric/metric.vue index 1f4f27998d..2786cda233 100644 --- a/app/src/panels/metric/metric.vue +++ b/app/src/panels/metric/metric.vue @@ -53,18 +53,19 @@ export default defineComponent({ const res = await api.get(`/items/${props.options.collection}`, { params: { aggregate: { - [props.options.function]: { - [props.options.field]: 'result', - }, + [props.options.function]: [props.options.field], }, filter: props.options.filter, sort: sort, }, }); - metric.value = Number(res.data.data[0].result).toLocaleString(undefined, { - minimumFractionDigits: props.options.decimals ?? 2, - }); + metric.value = Number(res.data.data[0][`${props.options.field}_${props.options.function}`]).toLocaleString( + undefined, + { + minimumFractionDigits: props.options.decimals ?? 2, + } + ); } catch (err) { // oh no } finally {