I have created a query to search the database and then display the results in an empty table. After displaying the results, I want to display a certain text if the search is successful or unsuccessful. How do I do that? I currently have these codes below for the query:
import wixData from “wix-data” ;
$w . onReady ( function () {
$w ( “#recalltable” ). columns = [
{
“id” : “col1” ,
“dataPath” : “title” ,
“label” : “VIN Number” ,
“width” : 120 ,
“type” : “string” ,
},
{
“id” : “col2” ,
“dataPath” : “model” ,
“label” : “Model” ,
“width” : 100 ,
“type” : “string” ,
},
{
“id” : “col3” ,
“dataPath” : “code” ,
“label” : “Campaign Code” ,
“width” : 50 ,
“type” : “string” ,
}];
});
export function searchbtn_click ( event ) {
wixData . query ( “Recall” )
. eq ( “title” , $w ( “#vininput” ). value )
. find ()
. then ( res => {
$w ( “#recalltable” ). rows = res . items
$w ( “#recalltable” ). expand ()
**let** allResults = res ;
});
}
Any help is very much appreciated!