mirror of
https://github.com/LukeHagar/developer.sailpoint.com.git
synced 2025-12-07 20:37:46 +00:00
filtering works for multiple values
This commit is contained in:
@@ -9,7 +9,7 @@ export default function BlogCards({
|
||||
const [cardData, setCardData] = React.useState();
|
||||
|
||||
const getPosts = async () => {
|
||||
const data = await getBlogPosts(filterCallback);
|
||||
const data = await getBlogPosts(filterCallback.join(','));
|
||||
console.log(data.topics)
|
||||
const resultset = []
|
||||
for (const topic of data.topics) {
|
||||
|
||||
@@ -10,14 +10,22 @@ import BlogCards from '../components/blog/BlogCards';
|
||||
import BlogSidebar from '../components/blog/BlogSidebar';
|
||||
|
||||
export default function Blog() {
|
||||
const [filteredProduct, setFilteredProduct] = React.useState();
|
||||
const [filteredProduct, setFilteredProduct] = React.useState([]);
|
||||
|
||||
const {siteConfig} = useDocusaurusContext();
|
||||
|
||||
const handleClick = (data) => {
|
||||
console.log(data)
|
||||
var tempFilter = filteredProduct.slice()
|
||||
|
||||
setFilteredProduct(data)
|
||||
const index = tempFilter.indexOf(data);
|
||||
if (index !== -1) {
|
||||
tempFilter.splice(index, 1);
|
||||
} else {
|
||||
tempFilter.push(data)
|
||||
}
|
||||
|
||||
setFilteredProduct(tempFilter)
|
||||
};
|
||||
return (
|
||||
<Layout description="The SailPoint Developer Community has everything you need to build, extend, and automate scalable identity solutions.">
|
||||
|
||||
Reference in New Issue
Block a user