mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-22 03:07:04 +02:00
avatars use id
This commit is contained in:
1 parent
1f204918a5
commit
0c8bb4be21
3 files changed
+3
-7
No files matched your search
@@ -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 } }));
|
||||
});
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user