Skip to content

Commit

Permalink
fix: change filter from geral query to description
Browse files Browse the repository at this point in the history
  • Loading branch information
cesarhenrq committed Oct 17, 2023
1 parent 7aa013a commit c72f790
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
12 changes: 6 additions & 6 deletions src/contexts/filters/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,17 +115,17 @@ export const addMaxWage = (maxWage: string) => {
};
};

export const addGeralQuery = (geralQuery: string) => {
export const addDescription = (description: string) => {
return {
type: 'ADD_GERAL_QUERY',
payload: geralQuery,
type: 'ADD_DESCRIPTION',
payload: description,
};
};

export const removeGeralQuery = (geralQuery: string) => {
export const removeDescription = (description: string) => {
return {
type: 'REMOVE_GERAL_QUERY',
payload: geralQuery,
type: 'REMOVE_DESCRIPTION',
payload: description,
};
};

Expand Down
12 changes: 6 additions & 6 deletions src/contexts/filters/dispatcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export type Filters = {
maxWage: string;
levels: string[];
role: string;
geralQuery: string;
description: string;
};

export const initialState: Filters = {
Expand All @@ -23,7 +23,7 @@ export const initialState: Filters = {
maxWage: '',
levels: [],
role: '',
geralQuery: '',
description: '',
};

export const filtersDispatcher = (
Expand Down Expand Up @@ -119,15 +119,15 @@ export const filtersDispatcher = (
...state,
maxWage: action.payload,
};
case 'ADD_GERAL_QUERY':
case 'ADD_DESCRIPTION':
return {
...state,
geralQuery: action.payload,
description: action.payload,
};
case 'REMOVE_GERAL_QUERY':
case 'REMOVE_DESCRIPTION':
return {
...state,
geralQuery: '',
description: '',
};
case 'RESET_FILTERS':
return initialState;
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useSearchHandling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const useSearchHandling = (
} else if (roles.includes(positionOrTech)) {
filtersDispatch(actions.addRole(positionOrTech));
} else {
filtersDispatch(actions.addGeralQuery(positionOrTech));
filtersDispatch(actions.addDescription(positionOrTech));
}

queryDispatch(queryActions.setQuery(buildQueryString(filters)));
Expand Down
2 changes: 1 addition & 1 deletion src/pages/VacanciesPage/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const VacanciesPage = styled.div`
export const Charts = styled.div`
display: grid;
grid-template-columns: 1fr 1fr;
gap: 30px;
gap: 32px;
width: 100%;
`;

Expand Down

0 comments on commit c72f790

Please sign in to comment.