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

fix: filtering content without theme-id #482

Merged
merged 1 commit into from
Oct 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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