Cuando llamo a la función lookUpItem desde ItemSearch.vue, obtengo undefined.
ItemSearch.vue
<script setup lang="ts"> import { lookUpItem } from '../systemApi' async function getItemDetails() { const response = await lookUpItem(mNumber, location) } </script>systemAPI.ts
export async function lookUpItem(mNumber: number, location: number) { getHash().then((hash) => { axios.get(url) .then((response) => { // console.log(response) <- outputs the correct data to console. return response }Podrías intentar esto:
Para una mejor lectura (y comprensión)
export async function lookUpItem(mNumber: number, location: number) { try{ const hash = await getHash(); const response = await axios.get(url); return response; }catch(err){ throw err; } }