mirror of
https://github.com/LukeHagar/developer.sailpoint.com.git
synced 2025-12-09 12:27:47 +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 [cardData, setCardData] = React.useState();
|
||||||
|
|
||||||
const getPosts = async () => {
|
const getPosts = async () => {
|
||||||
const data = await getBlogPosts(filterCallback);
|
const data = await getBlogPosts(filterCallback.join(','));
|
||||||
console.log(data.topics)
|
console.log(data.topics)
|
||||||
const resultset = []
|
const resultset = []
|
||||||
for (const topic of data.topics) {
|
for (const topic of data.topics) {
|
||||||
|
|||||||
@@ -10,14 +10,22 @@ import BlogCards from '../components/blog/BlogCards';
|
|||||||
import BlogSidebar from '../components/blog/BlogSidebar';
|
import BlogSidebar from '../components/blog/BlogSidebar';
|
||||||
|
|
||||||
export default function Blog() {
|
export default function Blog() {
|
||||||
const [filteredProduct, setFilteredProduct] = React.useState();
|
const [filteredProduct, setFilteredProduct] = React.useState([]);
|
||||||
|
|
||||||
const {siteConfig} = useDocusaurusContext();
|
const {siteConfig} = useDocusaurusContext();
|
||||||
|
|
||||||
const handleClick = (data) => {
|
const handleClick = (data) => {
|
||||||
console.log(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 (
|
return (
|
||||||
<Layout description="The SailPoint Developer Community has everything you need to build, extend, and automate scalable identity solutions.">
|
<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