! ! ! Only LOGGED-IN USER WILL SEE A RESULT ! ! !
! ! ! Redirection starts when access granted ! ! !
Registered-Member-List

! ! ! Only the ADMIN can see the whole member-list ! ! !
.
CODE

import wixLocation from 'wix-location';
import wixData from 'wix-data';
$w.onReady(function() { })
​
export function button7_click(event) {
let EmailInput = $w('#input7').value;
console.log(EmailInput)
wixData.query('myDatabase')
.eq('email', EmailInput)
.find()
.then(result => {
let numberOfItems = result.totalCount;
console.log(numberOfItems)
if (numberOfItems === 0) {
wixLocation.to("https://www.ebay.com");
}
else {
let callsign = ".com/" //---> deaktivated //$w('#input7').value;
wixLocation.to("https://www.google" + callsign);
}
})
}
​
​
​
​
​
​
function get_AllMembers(event) {
wixData.query("Members/PrivateMembersData")
.find()
.then(results => {
console.log(results)
let numberOfItems = results.totalCount;
console.log(numberOfItems)
let itemLength=results.items.length
console.log(itemLength)
let item=results.items
console.log(item)
for (var i = 0; i < numberOfItems; i++) {
console.log(item[i].loginEmail)
}
})
}