Skip to content
Snippets Groups Projects
Commit 8ad3129d authored by Karsch Lukas's avatar Karsch Lukas
Browse files

#40 refactor: rename hook to "useGrowbrosFetcher" to avoid name clashing

parent 7827524d
No related branches found
No related tags found
1 merge request!28Closes #40 : Custom useGrowbrosFetcher hook to make calls to the backend.
......@@ -90,7 +90,7 @@ export class BackendConnectorImpl implements IBackendConnector {
}
async clearGarden(): Promise<FetchResult<number>> {
let result: FetchResult<number> = {};
let result: FetchResult<number>;
try {
const res = await this.makeFetchWithAuthAndOptions("/garden/remove/all", {method: "DELETE"});
const num = await res.json();
......@@ -159,7 +159,7 @@ export class BackendConnectorImpl implements IBackendConnector {
}
async clearWishlist(): Promise<FetchResult<number>> {
let result: FetchResult<number> = {};
let result: FetchResult<number>;
try {
const res = await this.makeFetchWithAuthAndOptions("/wishlist/remove/all", {method: "DELETE"});
const num = await res.json();
......
......@@ -8,10 +8,10 @@ const createFetcherInstance = (): IBackendConnector => {
return new BackendConnectorImpl(backendUrl);
};
const useFetcher = (): IBackendConnector => {
const useGrowbrosFetcher = (): IBackendConnector => {
const fetcherInstance = useMemo(() => createFetcherInstance(), []);
return fetcherInstance;
};
export default useFetcher;
export default useGrowbrosFetcher;
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