Skip to content

Commit

Permalink
fix "versions" showing up in /textures/versions
Browse files Browse the repository at this point in the history
  • Loading branch information
3vorp committed Aug 16, 2024
1 parent 5e6f4ee commit 2a83fc3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
5 changes: 4 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,10 @@ app.use((err: any, req: Request, res: Response, next: NextFunction) => {

if (process.env.VERBOSE === "true")
console.error(
`[${new Date().toUTCString()}] Code, Message, Stack ${code}`, message, "\n", stack,
`[${new Date().toUTCString()}] Code, Message, Stack ${code}`,
message,
"\n",
stack,
);

let name = err?.response?.data?.name || err.name;
Expand Down
9 changes: 5 additions & 4 deletions src/v2/repository/texture.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ export default class TextureFirestormRepository implements TextureRepository {
}

public async getVersions(): Promise<Array<string>> {
const versions = await settings.get("versions");
return Object.values(versions).flat().sort(MinecraftSorter).reverse();
const s = await settings.readRaw();
return Object.values(s.versions).flat().sort(MinecraftSorter).reverse();
}

public async getVersionByEdition(edition: Edition): Promise<Array<string>> {
Expand All @@ -156,8 +156,9 @@ export default class TextureFirestormRepository implements TextureRepository {
return versions[edition];
}

public createTexture(texture: TextureCreationParam): Promise<Texture> {
return textures.add(texture).then((id: string) => this.searchTextureByNameOrId<true>(id));
public async createTexture(texture: TextureCreationParam): Promise<Texture> {
const id = await textures.add(texture);
return this.searchTextureByNameOrId<true>(id);
}

public async deleteTexture(id: string): Promise<WriteConfirmation[]> {
Expand Down

0 comments on commit 2a83fc3

Please sign in to comment.