Skip to content
Snippets Groups Projects
Commit 040f12fe authored by hudaal's avatar hudaal
Browse files

Sort the search

parent 022f96c3
No related branches found
No related tags found
1 merge request!3More cypress testing
......@@ -27,7 +27,7 @@ const checkTypeToChangePage = (page: number, searchValue:string, filterType: str
query = '{tag(tag:"' + filterType + '") {articleConnection {article (limit: 4, page: '+page+') {authorConnection {author{firstName lastName}} commentConnection{text} id text title timestamp}}}}';
else
query = '{article(limit: 4, page: '+page+'){authorConnection {author{firstName lastName}} commentConnection{text} id text title timestamp}}';
query = '{article(title: "'+ searchValue +'", limit: 4, page: '+page+'){authorConnection {author{firstName lastName}} commentConnection{text} id text title timestamp}}';
return query
}
......@@ -65,7 +65,7 @@ const searchReducer = (state:'', action: Action) => {
case "Sort":
page = 0;
sort = true;
query = '{article(alphabetically: true, limit: 4, page: '+page+') {authorConnection {author{firstName lastName}} commentConnection{text} id text title timestamp}}';
query = '{article(title: "'+ searchValue +'", alphabetically: true, limit: 4, page: '+page+') {authorConnection {author{firstName lastName}} commentConnection{text} id text title timestamp}}';
return {query: query, page: page};
case "AddPage":
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment