fix: capture page
This commit is contained in:
parent
689edac83e
commit
db85d80ddb
|
@ -10,13 +10,13 @@ export { getServerSideProps } from "../web/search/anySearchPage";
|
||||||
|
|
||||||
const CapturePage: NextPage<Props> = (props) => {
|
const CapturePage: NextPage<Props> = (props) => {
|
||||||
return (
|
return (
|
||||||
<Layout page={"capture"}>
|
<Layout page="capture">
|
||||||
<CommonDisplay
|
<CommonDisplay
|
||||||
{...props}
|
{...props}
|
||||||
hasSearchbar={true}
|
hasSearchbar={true}
|
||||||
hasCapture={true}
|
hasCapture={true}
|
||||||
hasAdvancedOptions={false}
|
hasAdvancedOptions={false}
|
||||||
placeholder={"Get best title match..."}
|
placeholder="Get best title match..."
|
||||||
displaySeeMoreHint={false}
|
displaySeeMoreHint={false}
|
||||||
displayQuestionsWrapper={displayQuestionsWrapperForCapture}
|
displayQuestionsWrapper={displayQuestionsWrapperForCapture}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -81,27 +81,28 @@ const CommonDisplay: React.FC<Props> = ({
|
||||||
|
|
||||||
if (queryIsEmpty) {
|
if (queryIsEmpty) {
|
||||||
const filterManually = (results: QuestionFragment[]) => {
|
const filterManually = (results: QuestionFragment[]) => {
|
||||||
|
let filteredResults = [...results];
|
||||||
if (
|
if (
|
||||||
queryParameters.forecastingPlatforms &&
|
queryParameters.forecastingPlatforms &&
|
||||||
queryParameters.forecastingPlatforms.length > 0
|
queryParameters.forecastingPlatforms.length > 0
|
||||||
) {
|
) {
|
||||||
results = results.filter((result) =>
|
filteredResults = filteredResults.filter((result) =>
|
||||||
queryParameters.forecastingPlatforms.includes(result.platform.id)
|
queryParameters.forecastingPlatforms.includes(result.platform.id)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (queryParameters.starsThreshold === 4) {
|
if (queryParameters.starsThreshold === 4) {
|
||||||
results = results.filter(
|
filteredResults = filteredResults.filter(
|
||||||
(result) => result.qualityIndicators.stars >= 4
|
(result) => result.qualityIndicators.stars >= 4
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (queryParameters.forecastsThreshold) {
|
if (queryParameters.forecastsThreshold) {
|
||||||
// TODO / FIXME / remove?
|
// TODO / FIXME / remove?
|
||||||
}
|
}
|
||||||
return results;
|
return filteredResults;
|
||||||
};
|
};
|
||||||
return filterManually(defaultResults);
|
return filterManually(defaultResults);
|
||||||
} else {
|
} else {
|
||||||
return queryResults.data?.result;
|
return queryResults.data?.result || [];
|
||||||
}
|
}
|
||||||
}, [queryResults.data, queryParameters]);
|
}, [queryResults.data, queryParameters]);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user