Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

Commit

Permalink
fix: filtering content without theme-id (#482)
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianRid authored Oct 4, 2023
1 parent 25eb7aa commit 00eb9e9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 0 additions & 1 deletion tumeplayMobile/src/views/Contents.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {Colors} from '../styles/Style';
import {GET_LEVELS} from '../services/api/levels';
import config from '../../config';
import EncryptedStorage from 'react-native-encrypted-storage';
import Snackbar from '../components/Contents/Snackbar';
import handleRedirection from '../services/handleRedirection';
import Event from '../services/api/matomo';
import {useFocusEffect} from '@react-navigation/native';
Expand Down
5 changes: 4 additions & 1 deletion tumeplayMobile/src/views/Search.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ const Search = () => {
fetch(`${apiUrl}/contents?_q=${searchText}`)
.then(res =>
res.json().then(data => {
data.length > 0 ? setContents(data) : setNoResults(true);
const filteredContents = data.filter(
content => !!content.thematique_mobile,
);
data.length > 0 ? setContents(filteredContents) : setNoResults(true);
}),
)
.catch(err => console.log(err))
Expand Down

0 comments on commit 00eb9e9

Please sign in to comment.