I am experiencing issues populating wix API fetched data to a repeater, though i did follow some example here i get an error, not sure why…
Link to a example: Wix: Populate repeater with external API call
here is the error:
Wix code SDK error: Each item in the items array must have a member named `_id` which contains a unique value identifying the item.
Wix code SDK Warning: The data that was passed to data contained at least two items with the same ID: . Only the first item was accepted.
my current code
import {getCurrentTemp} from 'backend/serviceModule';
//...
export function buttonFetch_click(event, $w) {
getCurrentTemp($w("#emailInput").value)
.then(CurrentTemp => {
// add an _id property to each object
CurrentTemp.forEach(item => item._id = item.id)
// feed the data to the repeater
$w('#repeater1').data = CurrentTemp;
} );
}
export function repeater1_itemReady($item, itemData, index) {
$item("#textResults").text = "Name: " + itemData.Title + "\n"
+ "Symbol: " + itemData.BreachDate + "\n"
+ "Rank: " + itemData.Description + "\n"
+ "Price (USD): " + itemData.DataClasses;
}