Problem with collection

Ok fixed that error but now i don’t get the result from the search box nombrerelato and the categoria doesn’t display the options.

this is the code

import wixData from “wix-data”

$w.onReady(() => {
loadCategoria();
});

let lastFilterNombrerelato;
let lastFilterCategoria
let debounceTimer;
export function Irelato_keyPress_1(event, $w) {
if (debounceTimer){
clearTimeout(debounceTimer);
debounceTimer = undefined;
}
debounceTimer = setTimeout(() => {
filter($w(‘#Irelato’).value);},500);
}

export function dropdown1_change(event, $w) {
filter(lastFilterCategoria, $w(‘#dropdown1’).value);
}

function filter (nombrerelato, categoria){
if (lastFilterNombrerelato !== nombrerelato || lastFilterCategoria !== categoria) {
let newFilter = wixData.filter();
if (nombrerelato)
newFilter = newFilter.contains(‘nombrerelato’, nombrerelato);
if (categoria)
newFilter = newFilter.contains(‘categoria’, categoria)
$w(‘#dataset1’).setFilter(newFilter);
lastFilterNombrerelato = nombrerelato;
lastFilterCategoria = categoria;
}
}

function loadCategoria (){
wixData.query(‘ParticipantesConcurso’)
.distinct(“title”)
.then((res) => {
let categories = res.items;
let options = categories.map(c => { return {“label”: c, “value”: c}});
$w(“#dropdown1”).options = options;
})
}