generated from ConductionNL/product-website-template
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #159 from ConductionNL/development
Development to main, week 45
- Loading branch information
Showing
29 changed files
with
253 additions
and
251 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { TSendFunction } from "../apiService"; | ||
import { AxiosInstance } from "axios"; | ||
|
||
export default class AvailableFilters { | ||
private _instance: AxiosInstance; | ||
private _send: TSendFunction; | ||
|
||
constructor(_instance: AxiosInstance, send: TSendFunction) { | ||
this._instance = _instance; | ||
this._send = send; | ||
} | ||
|
||
public getCategories = async (): Promise<any> => { | ||
let endpoint = "/openWOO?_queries[]=Categorie"; | ||
|
||
if (window.sessionStorage.getItem("OIDN_NUMBER")) { | ||
endpoint += `&oidn=${window.sessionStorage.getItem("OIDN_NUMBER")}`; | ||
} | ||
|
||
const { data } = await this._send(this._instance, "GET", endpoint); | ||
|
||
return data; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import * as React from "react"; | ||
import { useQuery } from "react-query"; | ||
import APIService from "../apiService/apiService"; | ||
import APIContext from "../apiService/apiContext"; | ||
|
||
export const useAvailableFilters = () => { | ||
const API: APIService | null = React.useContext(APIContext); | ||
|
||
const getCategories = () => | ||
useQuery<any, Error>(["available_catagories"], () => API?.AvailableFilters.getCategories(), { | ||
onError: (error) => { | ||
console.warn(error.message); | ||
}, | ||
}); | ||
|
||
return { getCategories }; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.