refactor: reorganize pet action types and update related components for improved resource management

This commit is contained in:
2025-02-09 21:23:07 -03:00
parent c2e5bf92a3
commit 88a9c6507c
8 changed files with 98 additions and 72 deletions

View File

@@ -1,7 +1,7 @@
import { ApiService } from './index';
import { InvItemInteraction, Pet, Resources } from '../../types/Pet';
import { PetCreationRequest } from '../../types/PetCreationRequest';
import { PetUpdateActionRequest } from '../../types/PetUpdateActionRequest';
import { PetActionGathered, PetUpdateActionRequest } from '../../types/PetAction';
import { PetSkill, Skill } from '../../types/Skills';
// Get API service instance
@@ -22,8 +22,8 @@ export async function updatePetAction(petId: string, data: PetUpdateActionReques
return response.data;
}
export async function getPetGatheredResources(petId: string): Promise<Resources> {
const response = await api.get<Resources>(`/api/v1/pet/${petId}/resources/gathered`);
export async function getPetGatheredResources(petId: string): Promise<PetActionGathered[]> {
const response = await api.get<PetActionGathered[]>(`/api/v1/pet/${petId}/resources/gathered`);
return response.data;
}