Fix issue with unicode filtering. Closes #1258

This commit is contained in:
Mike Cao 2022-07-21 01:35:14 -07:00
parent be8291c856
commit 358c725828
2 changed files with 3 additions and 2 deletions

View File

@ -2,6 +2,7 @@ import React from 'react';
import classNames from 'classnames';
import Button from 'components/common/Button';
import Times from 'assets/times.svg';
import { safeDecodeURI } from 'lib/url';
import styles from './FilterTags.module.css';
export default function FilterTags({ params, onClick }) {
@ -17,7 +18,7 @@ export default function FilterTags({ params, onClick }) {
return (
<div key={key} className={styles.tag}>
<Button icon={<Times />} onClick={() => onClick(key)} variant="action" iconRight>
{`${key}: ${params[key]}`}
{`${key}: ${safeDecodeURI(params[key])}`}
</Button>
</div>
);

View File

@ -41,7 +41,7 @@ export default async (req, res) => {
const stats = Object.keys(metrics[0]).reduce((obj, key) => {
obj[key] = {
value: Number(metrics[0][key]) || 0,
change: Number(metrics[0][key] - prevPeriod[0][key]) || 0,
change: Number(metrics[0][key]) - Number(prevPeriod[0][key]) || 0,
};
return obj;
}, {});