feat: implement item icon loading in InventoryModal and add API function to fetch item icons

This commit is contained in:
2025-02-12 21:22:22 -03:00
parent 88a9c6507c
commit 62634a426e
3 changed files with 72 additions and 8 deletions

View File

@@ -50,4 +50,14 @@ export async function postAllocatePetSkill(petId: string, skillId: number): Prom
export async function putPetItemInteract(petId: string, itemId: number, inter: InvItemInteraction): Promise<Pet> {
const response = await api.put<Pet>(`/api/v1/inventory/${petId}/${itemId}/${inter.toLowerCase()}`);
return response.data;
}
export async function getItemIcon(itemId: number): Promise<Blob> {
const response = await api.get<Blob>(`/api/v1/gamedata/item/icon/${itemId}`, {
responseType: 'blob',
headers: {
Accept: 'image/png'
}
});
return response.data;
}