Browse Source

Implemented Hash Tags Filter

Savio Fernando 1 year ago
parent
commit
12b81acbe9
1 changed files with 7 additions and 1 deletions
  1. 7 1
      src/screens/Search/SearchListPage.js

+ 7 - 1
src/screens/Search/SearchListPage.js

@@ -12,6 +12,11 @@ import ThemedTextButton from '../../components/molecules/Buttons/ThemeTextButton
 import fonts from '../../constants/fonts'
 import fonts from '../../constants/fonts'
 import HorizontalNewsCardVariant from '../../components/molecules/Cards/HorizontalNewsCardVariant'
 import HorizontalNewsCardVariant from '../../components/molecules/Cards/HorizontalNewsCardVariant'
 
 
+const filterMapping = {
+    "hash_tags": "tag",
+    "source":"source",
+    "category":"category"
+}
 
 
 const SearchListPage = props => {
 const SearchListPage = props => {
     const {
     const {
@@ -155,10 +160,11 @@ const SearchListPage = props => {
         for (const obj of Object.entries(filterObject)) {
         for (const obj of Object.entries(filterObject)) {
             for (const filter of Object.entries(obj[1])) {
             for (const filter of Object.entries(obj[1])) {
                 if (filter[1] === true) {
                 if (filter[1] === true) {
-                    filterText += `&${obj[0]}=${category[0]}`
+                    filterText += `&${filterMapping[obj[0]]}=${filter[0]}`
                 }
                 }
             }
             }
         }
         }
+        console.log(filterText)
         return filterText
         return filterText
     }
     }