feat: implement item icon loading in InventoryModal and add API function to fetch item icons
This commit is contained in:
@@ -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;
|
||||
}
|
Reference in New Issue
Block a user