mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 20:19:49 +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";
|
import { imageProxy } from "../../../core/api/imageProxy";
|
||||||
|
|
||||||
export const getStaticPaths = (async () => {
|
export const getStaticPaths = (async () => {
|
||||||
const avatars = await api.avatars();
|
const { avatars } = await api.avatars();
|
||||||
|
|
||||||
return avatars.map((avatar) => ({
|
return avatars.map((avatar) => ({
|
||||||
params: { id: avatar.name },
|
params: { id: avatar.name },
|
||||||
@@ -15,7 +15,5 @@ export const getStaticPaths = (async () => {
|
|||||||
*/
|
*/
|
||||||
export async function GET({ params }: APIContext<never, { id: string }>) {
|
export async function GET({ params }: APIContext<never, { id: string }>) {
|
||||||
const avatar = await api.avatar(params.id);
|
const avatar = await api.avatar(params.id);
|
||||||
const profileAvatar = avatar.ProfileAvatar();
|
return await imageProxy(avatar.profile_avatar!.avatar);
|
||||||
|
|
||||||
return await imageProxy(profileAvatar.avatar);
|
|
||||||
}
|
}
|
||||||
@@ -3,10 +3,10 @@ import { api } from "../../../core/api/dynamic";
|
|||||||
import { imageProxy } from "../../../core/api/imageProxy";
|
import { imageProxy } from "../../../core/api/imageProxy";
|
||||||
|
|
||||||
export const getStaticPaths = (async () => {
|
export const getStaticPaths = (async () => {
|
||||||
const backgrounds = await api.backgrounds();
|
const { backgrounds } = await api.backgrounds();
|
||||||
|
|
||||||
return backgrounds.map((avatar) => ({
|
return backgrounds.map((background) => ({
|
||||||
params: { id: avatar.name },
|
params: { id: background.name },
|
||||||
}));
|
}));
|
||||||
}) satisfies GetStaticPaths;
|
}) satisfies GetStaticPaths;
|
||||||
|
|
||||||
@@ -14,8 +14,6 @@ export const getStaticPaths = (async () => {
|
|||||||
* One day I will write documentation for this
|
* One day I will write documentation for this
|
||||||
*/
|
*/
|
||||||
export async function GET({ params }: APIContext<never, { id: string }>) {
|
export async function GET({ params }: APIContext<never, { id: string }>) {
|
||||||
const avatar = await api.background(params.id);
|
const background = await api.background(params.id);
|
||||||
const profileBackground = avatar.ProfileBackground();
|
return await imageProxy(background.profile_background!.background);
|
||||||
|
|
||||||
return await imageProxy(profileBackground.background);
|
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user