Skip to content
Snippets Groups Projects
Commit d8237b00 authored by lfr20's avatar lfr20
Browse files

When user changed type of the data(learn Obj, coll, user) by the dropdown, the Url changes

parent f6d95ae2
No related branches found
No related tags found
2 merge requests!57Merge of develop into master,!56Fixed buttons reportar, seguir, compartilhar, guardar and entrar (in comments...
......@@ -18,7 +18,7 @@ along with Plataforma Integrada MEC. If not, see <http://www.gnu.org/licenses/>
import React, { useEffect, useState, useContext } from "react";
import { apiDomain } from '../env';
import { Link } from "react-router-dom";
import { Link, useHistory } from "react-router-dom";
import styled from "styled-components";
import Paper from "@material-ui/core/Paper";
import LoadingSpinner from '../Components/LoadingSpinner';
......@@ -43,6 +43,8 @@ let currFilter = "";
let currOption;
export default function Search(props) {
const history = useHistory()
const { state, dispatch } = useContext(Store);
const [resultsResource, setResultsResource] = useState([]);
const [resultsCollection, setResultsCollection] = useState([]);
......@@ -164,8 +166,9 @@ export default function Search(props) {
onChange={(e) => {
setIsLoading(true);
currOption = e.value;
history.push(`/busca?query=${state.search.query}&search_class=${currOption}`)
setOption(currOption);
collectStuff(currOption, "");
// collectStuff(currOption, "");
}}
placeholder="Selecione um tipo"
/>
......
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