Added support to filter by multiple tags

This commit is contained in:
Alejandro Celaya
2018-08-04 17:07:44 +02:00
parent 9aaa01e455
commit ee6193ace8
3 changed files with 20 additions and 11 deletions

View File

@@ -13,8 +13,11 @@ export class ShortUrlsRow extends React.Component {
return <i className="nowrap"><small>No tags</small></i>;
}
const { refreshList } = this.props;
return tags.map(tag => <Tag key={tag} text={tag} onClick={() => refreshList({ tags: [tag] })} />);
const { refreshList, shortUrlsListParams } = this.props;
const selectedTags = shortUrlsListParams.tags || [];
return tags.map(
tag => <Tag key={tag} text={tag} onClick={() => refreshList({tags: [ ...selectedTags, tag ] })} />
);
}
render() {