I have created an API and defined it in my TypeScript file
const Book = {
async getBookType(intID: string): Promise<Book[]> {
// const intId = API.Product.getCurrentId();
const intId = '';
const response = await http.get('/myasset/booktypes', {
params: {
int_id: intID,
},
});
const bookTypes = JSON.parse(JSON.stringify(response.data));
return bookTypes;
},
};
Now, on my bookpage.vue, I want to fetch the API response and display the data on the page.
Could you provide an example of how I can achieve this using Vue.js?
When I examined the response body in Postman, here is what I found:
"adventure": 1,
"biography": 2,
"drama": 1,
"romance": 1
My goal is to simply display this data on the page.
Thank you in advance.