feat: add inventory and skill tree modals, enhance pet display with update handling
This commit is contained in:
@@ -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;
|
||||
}
|
Reference in New Issue
Block a user