This repository has been archived by the owner on Jul 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
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 #122 from floriaaan/feature/add-swagger-routes
[FEATURE] Add swagger page
- Loading branch information
Showing
10 changed files
with
4,898 additions
and
5,190 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
"use client"; | ||
import { RedocStandalone } from "redoc"; | ||
import { useQuery } from "@tanstack/react-query"; | ||
import { fetchAPI } from "@/lib/fetchAPI"; | ||
import { useAuth } from "@/hooks"; | ||
|
||
export default function Docs() { | ||
const { user, session } = useAuth(); | ||
|
||
const { data: doc, isLoading } = useQuery({ | ||
queryKey: ["docs"], | ||
queryFn: async () => { | ||
const res = await fetchAPI(`/docs`, session?.token); | ||
return await res.json(); | ||
}, | ||
}); | ||
|
||
if (isLoading) return ""; | ||
|
||
return ( | ||
<div> | ||
<RedocStandalone | ||
spec={doc} | ||
options={{ | ||
nativeScrollbars: true, | ||
theme: { colors: { primary: { main: "#F99436" } } }, | ||
}} | ||
/> | ||
</div> | ||
); | ||
} |
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.