change average price to median price on the dashboard (#300)

* change average price to median price on the dashboard

* Use more efficient median calculation

Co-authored-by: Christian Kellner <weakmap@gmail.com>

* Fix applied suggestion artifacts

* Update sql query and js sort function

* Group sql statement by id

* Revert sort function change

---------

Co-authored-by: Christian Kellner <weakmap@gmail.com>
This commit is contained in:
bytedream
2026-04-20 10:13:11 +02:00
committed by GitHub
parent 522bbc2282
commit cc0164b689
3 changed files with 35 additions and 21 deletions

View File

@@ -127,18 +127,18 @@ export default function Dashboard() {
</Col>
<Col xs={24} sm={12} md={12} lg={6} xl={6}>
<KpiCard
title="Avg. Price"
title="Median Price"
color="purple"
value={`${
!kpis.avgPriceOfListings
!kpis.medianPriceOfListings
? '---'
: new Intl.NumberFormat('de-DE', {
style: 'currency',
currency: 'EUR',
}).format(kpis.avgPriceOfListings)
}).format(kpis.medianPriceOfListings)
}`}
icon={<IconNoteMoney />}
description="Avg. Price of listings"
description="Median Price of listings"
/>
</Col>
</Row>