No success…
I did it :
export function get_li () {
let options = {
“headers” : {
“Content-Type” : “application/json” ,
“Access-Control-Allow-Origin” : “*” ,
“Access-Control-Allow-Methods” : “POST, GET, OPTIONS” ,
}
};
// query a collection to find matching items
return wixData . query ( “RH” )
. eq ( “email” , email )
. find ()
. then ( ( results ) => {
// matching items were found
if ( results . items . length > 0 ) {
options . body = {
photo : ‘https://static.wixstatic.com/media/’ + results . items [ 0 ]. photo . r . split ( ‘/’ )[ 3 ],
};
return ok ( options );
}
// no matching items found
options . body = {
“error” : ' ${ email } ' was not found
};
return notFound ( options );
} )
// something went wrong
. catch ( ( error ) => {
options . body = {
“error” : error
};
return serverError ( options );
})
}
And now i get this following on my chrome console =>
![]()