Hi,
I have a problem with my code or something I’m missing I won’t know.
I’m using third party API to call the data & after that, I want to show on my page repeater but the problem is when I preview my website the code is connected to my database item value successfully ( as showing in verbose: [Dataset - Connected] ‘myDataset’ collection to element ‘#image3’ ) but there is no item showing in page repeater (front-end).
My backend:
import { fetch } from 'wix-fetch';
import wixData from 'wix-data';
export async function getData() {
const apiKey = "xxxxxxxxxx";
//const id = "xxxxxxxxxxxx";
let id = wixData.get("myDataset", 'title');
const response = await fetch("https://www.exampleapi.com/&id=" + id + "&key=" + apiKey, {
method: 'get'
});
That’s my front end:
import { getData } from 'backend/getnam.jsw';
$w.onReady(function () {
getData()
.then((response) => {
let firstName = response.items[0].title;
//console.log(channelName);
$w("#name").text = firstName;
});
});
#database #backend #corvid #repeaters