aboutsummaryrefslogtreecommitdiffstats
path: root/src/api.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/api.ts')
-rw-r--r--src/api.ts8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/api.ts b/src/api.ts
index c486acc..226e213 100644
--- a/src/api.ts
+++ b/src/api.ts
@@ -12,12 +12,6 @@ const fetcher = (baseUrl: string) => (path: string) => fetch(`${baseUrl}${path}`
throw err
})
-interface Example {
- id: string
- title: string
- content: string
-}
-
export interface APISuccess<D> {
readonly type: "success"
data: D
@@ -77,7 +71,7 @@ const postRequest = async <R, D, E>({ baseUrl, path, body }: BasePostRequest<R>,
}
}
-export const useExamples = () => mapSWRResult<Example[], Error>(
+export const useExamples = () => mapSWRResult<ExampleApi.ListResponse.Body, Error>(
useSWR(ExampleApi.ListRequest.path, fetcher(EXAMPLE_API_URL)),
)