mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 18:57:03 +02:00
fix: webp
This commit is contained in:
1 parent
1a639c51e1
commit
033660c2d9
2 files changed
+7
-11
No files matched your search
@@ -3,7 +3,7 @@ import { api } from "../../../core/api/dynamic";
|
||||
import { imageProxy } from "../../../core/api/imageProxy";
|
||||
|
||||
export const getStaticPaths = (async () => {
|
||||
const avatars = await api.avatars();
|
||||
const { avatars } = await api.avatars();
|
||||
|
||||
return avatars.map((avatar) => ({
|
||||
params: { id: avatar.name },
|
||||
@@ -15,7 +15,5 @@ export const getStaticPaths = (async () => {
|
||||
*/
|
||||
export async function GET({ params }: APIContext<never, { id: string }>) {
|
||||
const avatar = await api.avatar(params.id);
|
||||
const profileAvatar = avatar.ProfileAvatar();
|
||||
|
||||
return await imageProxy(profileAvatar.avatar);
|
||||
return await imageProxy(avatar.profile_avatar!.avatar);
|
||||
}
|
||||
@@ -3,10 +3,10 @@ import { api } from "../../../core/api/dynamic";
|
||||
import { imageProxy } from "../../../core/api/imageProxy";
|
||||
|
||||
export const getStaticPaths = (async () => {
|
||||
const backgrounds = await api.backgrounds();
|
||||
const { backgrounds } = await api.backgrounds();
|
||||
|
||||
return backgrounds.map((avatar) => ({
|
||||
params: { id: avatar.name },
|
||||
return backgrounds.map((background) => ({
|
||||
params: { id: background.name },
|
||||
}));
|
||||
}) satisfies GetStaticPaths;
|
||||
|
||||
@@ -14,8 +14,6 @@ export const getStaticPaths = (async () => {
|
||||
* One day I will write documentation for this
|
||||
*/
|
||||
export async function GET({ params }: APIContext<never, { id: string }>) {
|
||||
const avatar = await api.background(params.id);
|
||||
const profileBackground = avatar.ProfileBackground();
|
||||
|
||||
return await imageProxy(profileBackground.background);
|
||||
const background = await api.background(params.id);
|
||||
return await imageProxy(background.profile_background!.background);
|
||||
}
|
||||
Reference in new issue
Block a user