mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 12:09:51 +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()
|
@Cache()
|
||||||
async avatar(id: string) {
|
async avatar(id: string) {
|
||||||
const avatar = this.metadata.item(id);
|
const avatar = this.metadata.item(id);
|
||||||
const name = avatar.name;
|
|
||||||
const stuff_ui = avatar.StuffUI("UIComponent");
|
const stuff_ui = avatar.StuffUI("UIComponent");
|
||||||
const profile_avatar = avatar.ProfileAvatar();
|
const profile_avatar = avatar.ProfileAvatar();
|
||||||
const sellable = avatar.components.sellableComponent
|
const sellable = avatar.components.sellableComponent
|
||||||
? avatar.Sellable()
|
? avatar.Sellable()
|
||||||
: undefined;
|
: undefined;
|
||||||
|
|
||||||
return { name, stuff_ui, profile_avatar, sellable };
|
return { id, stuff_ui, profile_avatar, sellable };
|
||||||
}
|
}
|
||||||
|
|
||||||
@Cache()
|
@Cache()
|
||||||
|
|||||||
@@ -2,5 +2,5 @@ import { assertSecret } from "@blitzkit/core";
|
|||||||
|
|
||||||
export function isChunkEnabled(chunk: string) {
|
export function isChunkEnabled(chunk: string) {
|
||||||
const buildChunk = assertSecret(import.meta.env.BUILD_CHUNK);
|
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 () => {
|
export const getStaticPaths = mixStaticPaths(_getStaticPaths, async () => {
|
||||||
const { avatars } = await api.avatars();
|
const { avatars } = await api.avatars();
|
||||||
|
return avatars.map(({ id }) => ({ params: { id } }));
|
||||||
return avatars.map((avatar) => ({
|
|
||||||
params: { id: avatar.name },
|
|
||||||
}));
|
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in new issue
Block a user