Sfoglia il codice sorgente

delete unnessary file

jam411 3 anni fa
parent
commit
fc380131f6
1 ha cambiato i file con 0 aggiunte e 27 eliminazioni
  1. 0 27
      packages/app/src/stores/useInstalledPlugins.ts

+ 0 - 27
packages/app/src/stores/useInstalledPlugins.ts

@@ -1,27 +0,0 @@
-import useSWR, { SWRResponse } from 'swr';
-
-import type { SearchResult, SearchResultItem } from '../interfaces/github-api';
-
-const pluginFetcher = (owner: string, repo: string) => {
-  return async() => {
-    const reqUrl = `/api/fetch_repository?owner=${owner}&repo=${repo}`;
-    const data = await fetch(reqUrl).then(res => res.json());
-    return data.searchResultItem;
-  };
-};
-
-export const useInstalledPlugin = (owner: string, repo: string): SWRResponse<SearchResultItem | null, Error> => {
-  return useSWR(`${owner}/{repo}`, pluginFetcher(owner, repo));
-};
-
-const pluginsFetcher = () => {
-  return async() => {
-    const reqUrl = '/api/fetch_repositories';
-    const data = await fetch(reqUrl).then(res => res.json());
-    return data.searchResult;
-  };
-};
-
-export const useInstalledPlugins = (): SWRResponse<SearchResult | null, Error> => {
-  return useSWR('/api/fetch_repositories', pluginsFetcher());
-};