feat: add inventory and skill tree modals, enhance pet display with update handling

This commit is contained in:
2025-02-05 20:36:59 -03:00
parent a624ba1e73
commit 243c50a1a0
6 changed files with 177 additions and 10 deletions

View File

@@ -1,5 +1,5 @@
import { ApiService } from './index';
import { Pet, Resources } from '../../types/Pet';
import { InvItemInteraction, Pet, Resources } from '../../types/Pet';
import { PetCreationRequest } from '../../types/PetCreationRequest';
import { PetUpdateActionRequest } from '../../types/PetUpdateActionRequest';
import { PetSkill, Skill } from '../../types/Skills';
@@ -42,7 +42,12 @@ export async function getPetSkills(petId: string): Promise<PetSkill[]> {
return response.data;
}
export async function postAllocatePetSkill(petId: string, skillId: int): Promise<PetSkill> {
const response = await api.get<PetSkill>(`/api/v1/skill/${petId}/allocate/${skillId}`);
export async function postAllocatePetSkill(petId: string, skillId: number): Promise<PetSkill> {
const response = await api.post<PetSkill>(`/api/v1/skill/${petId}/allocate/${skillId}`);
return response.data;
}
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;
}