avatars use id

This commit is contained in:
tresabhi committed 2026-06-05 11:28:25 -05:00
1 parent 1f204918a5
commit 0c8bb4be21
3 files changed
+3 -7

No files matched your search

+1 -2
View File
@@ -383,14 +383,13 @@ export class ServerAPI extends AbstractAPI {
@Cache()
async avatar(id: string) {
const avatar = this.metadata.item(id);
const name = avatar.name;
const stuff_ui = avatar.StuffUI("UIComponent");
const profile_avatar = avatar.ProfileAvatar();
const sellable = avatar.components.sellableComponent
? avatar.Sellable()
: undefined;
return { name, stuff_ui, profile_avatar, sellable };
return { id, stuff_ui, profile_avatar, sellable };
}
@Cache()
@@ -2,5 +2,5 @@ import { assertSecret } from "@blitzkit/core";
export function isChunkEnabled(chunk: string) {
const buildChunk = assertSecret(import.meta.env.BUILD_CHUNK);
return [chunk, "*"].includes(buildChunk);
return buildChunk === "*" || chunk === buildChunk;
}
@@ -5,10 +5,7 @@ import { getStaticPaths as _getStaticPaths } from "../_index";
export const getStaticPaths = mixStaticPaths(_getStaticPaths, async () => {
const { avatars } = await api.avatars();
return avatars.map((avatar) => ({
params: { id: avatar.name },
}));
return avatars.map(({ id }) => ({ params: { id } }));
});
/**