mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-12-05 15:52:55 +01:00
feat: some more docs
This commit is contained in:
1 parent
5feec9bf1e
commit
551108e047
8 files changed
+45
-7
No files matched your search
@@ -16,7 +16,7 @@ export const getStaticPaths = (async () => {
|
||||
*
|
||||
* @see avatars/list.json for all avatar ids.
|
||||
* @see avatars/[id].webp for avatar images.
|
||||
* @type avatar
|
||||
* @type avatar.Avatar
|
||||
*/
|
||||
export async function GET({ params }: APIContext<never, { id: string }>) {
|
||||
const avatar = await api.avatar(params.id);
|
||||
|
||||
@@ -4,6 +4,12 @@ import { imageProxy } from "../../../core/api/imageProxy";
|
||||
|
||||
export { getStaticPaths } from "./[id].json";
|
||||
|
||||
/**
|
||||
* Returns an avatar image based on its `id` in the `webp` format.
|
||||
*
|
||||
* @see avatars/list.json for all avatar ids.
|
||||
* @see avatars/[id].json for data on all avatar.
|
||||
*/
|
||||
export async function GET({ params }: APIContext<never, { id: string }>) {
|
||||
const avatar = await api.avatar(params.id);
|
||||
return await imageProxy(avatar.profile_avatar!.avatar);
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
import { api } from "../../../core/api/dynamic";
|
||||
|
||||
/**
|
||||
* Identical to `avatars/[id].json`, but returns data on all avatars at once,
|
||||
* mapped by `id`. Beware, the returned `JSON` is large.
|
||||
*
|
||||
* @type avatars.Avatars
|
||||
*/
|
||||
export async function GET() {
|
||||
const avatars = await api.avatars();
|
||||
return Response.json(avatars);
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import { api } from "../../../core/api/dynamic";
|
||||
|
||||
/**
|
||||
* @type avatar_list.AvatarList
|
||||
*/
|
||||
export async function GET() {
|
||||
const { avatars } = await api.avatars();
|
||||
const list = avatars.map((avatar) => avatar.name);
|
||||
const list = await api.avatarList();
|
||||
return Response.json(list);
|
||||
}
|
||||
Reference in new issue
Block a user