Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
remko48 committed Nov 14, 2023
1 parent b44778c commit a2b4066
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pwa/src/apiService/resources/availableFilters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default class AvailableFilters {
this._send = send;
}

public getCategory = async (): Promise<any> => {
public getCategories = async (): Promise<any> => {
let endpoint = "/openWOO?_queries[]=Categorie";

if (process.env.GATSBY_OIDN_NUMBER) {
Expand Down
6 changes: 3 additions & 3 deletions pwa/src/hooks/availableFilters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import APIContext from "../apiService/apiContext";
export const useAvailableFilters = () => {
const API: APIService | null = React.useContext(APIContext);

const getCategory = () =>
useQuery<any, Error>(["available_catagories"], () => API?.AvailableFilters.getCategory(), {
const getCategories = () =>
useQuery<any, Error>(["available_catagories"], () => API?.AvailableFilters.getCategories(), {
onError: (error) => {
console.warn(error.message);
},
});

return { getCategory };
return { getCategories };
};
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export const FiltersTemplate: React.FC<FiltersTemplateProps> = ({ isLoading }) =
navigate(`/${filtersToUrlQueryParams(filters)}`);
}, [filters]);

const getCategories = useAvailableFilters().getCategory();
const getCategories = useAvailableFilters().getCategories();

React.useEffect(() => {
if (!getCategories.isSuccess) return;
Expand Down

0 comments on commit a2b4066

Please sign in to comment.