This repository was archived by the owner on May 4, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 6 files changed +30
-7
lines changed
Expand file tree Collapse file tree 6 files changed +30
-7
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,10 @@ export default function FavoriteCookbooks() {
1616 const { data, loading, error } = useQuery < {
1717 user : { cookbooks : AssistantCookbook [ ] } ;
1818 } > ( GET_USER_SUBSCRIBED_COOKBOOKS , {
19- variables : GET_USER_SUBSCRIBED_COOKBOOKS_VARIABLES ,
19+ variables : {
20+ ...GET_USER_SUBSCRIBED_COOKBOOKS_VARIABLES ,
21+ name : filters . searchTerm ,
22+ } ,
2023 } ) ;
2124
2225 const userCookbooks = data ?. user ?. cookbooks || [ ] ;
Original file line number Diff line number Diff line change @@ -16,7 +16,10 @@ export default function MySnippets() {
1616 const { data, loading, error } = useQuery < {
1717 user : { recipes : AssistantRecipeWithStats [ ] } ;
1818 } > ( GET_USER_SUBSCRIBED_RECIPES , {
19- variables : GET_USER_SUBSCRIBED_RECIPES_VARIABLES ,
19+ variables : {
20+ ...GET_USER_SUBSCRIBED_RECIPES_VARIABLES ,
21+ name : filters . searchTerm ,
22+ } ,
2023 } ) ;
2124
2225 const userFavoriteRecipes = data ?. user ?. recipes || [ ] ;
Original file line number Diff line number Diff line change @@ -16,7 +16,10 @@ export default function MyCookbooks() {
1616 const { data, loading, error } = useQuery < {
1717 user : { cookbooks : AssistantCookbook [ ] } ;
1818 } > ( GET_USER_COOKBOOKS , {
19- variables : GET_USER_COOKBOOKS_VARIABLES ,
19+ variables : {
20+ ...GET_USER_COOKBOOKS_VARIABLES ,
21+ name : filters . searchTerm ,
22+ } ,
2023 } ) ;
2124
2225 const userCookbooks = data ?. user ?. cookbooks || [ ] ;
Original file line number Diff line number Diff line change @@ -16,7 +16,12 @@ export default function MySnippets() {
1616 const { data, loading, error } = useQuery < {
1717 user : { recipes : AssistantRecipeWithStats [ ] } ;
1818 } > ( GET_USER_RECIPES , {
19- variables : GET_USER_RECIPES_VARIABLES ,
19+ variables : {
20+ ...GET_USER_RECIPES_VARIABLES ,
21+ name : filters . searchTerm ,
22+ language : filters . language ,
23+ tag : filters . tags ,
24+ } ,
2025 } ) ;
2126
2227 const userRecipes = data ?. user ?. recipes || [ ] ;
Original file line number Diff line number Diff line change @@ -16,15 +16,17 @@ export default function TeamCookbooks() {
1616 const { data, loading, error } = useQuery < {
1717 cookbooks : AssistantCookbook [ ] ;
1818 } > ( GET_SHARED_COOKBOOKS , {
19- variables : GET_SHARED_COOKBOOKS_VARIABLES ,
19+ variables : {
20+ ...GET_SHARED_COOKBOOKS_VARIABLES ,
21+ name : filters . searchTerm ,
22+ } ,
2023 } ) ;
2124
2225 const userCookbooks = data ?. cookbooks || [ ] ;
2326
2427 // check the recipe against the search filters
2528 const filteredCookbooks = userCookbooks . filter ( ( cookbook ) => {
2629 if ( ! filterBy . name ( filters , cookbook . name ) ) return false ;
27- // if (!filterBy.language(filters, cookbook.language)) return false;
2830 if ( ! filterBy . privacy ( filters , cookbook . isPublic ) ) return false ;
2931 if ( ! filterBy . isSubscribed ( filters , cookbook . isSubscribed ) ) return false ;
3032 return true ;
Original file line number Diff line number Diff line change @@ -9,14 +9,21 @@ import SnippetTableEmptyFiltereed from 'renderer/components/SnippetTable/Snippet
99import SnippetTable from 'renderer/components/SnippetTable/SnippetTable' ;
1010import filterBy from 'renderer/components/Filters/filterBy' ;
1111import { useFilters } from 'renderer/components/FiltersContext' ;
12+ import { Language } from 'renderer/lib/constants' ;
1213
1314export default function TeamSnippets ( ) {
1415 const filters = useFilters ( ) ;
1516
1617 const { data, loading, error } = useQuery < {
1718 recipes : AssistantRecipeWithStats [ ] ;
1819 } > ( GET_SHARED_RECIPES , {
19- variables : GET_SHARED_RECIPES_VARIABLES ,
20+ variables : {
21+ ...GET_SHARED_RECIPES_VARIABLES ,
22+ name : filters . searchTerm ,
23+ languages :
24+ filters . language !== Language . ALL_LANGUAGES ? [ filters . language ] : null ,
25+ tag : filters . tags ,
26+ } ,
2027 } ) ;
2128
2229 const teamRecipes = data ?. recipes || [ ] ;
You can’t perform that action at this time.
0 commit comments