I have been trying to use code for an example of wix fetch command But this way of doing it leaves my data open to anyone whom can find the url is their a way to secure the url most apis have a barer token but this method does not appear to ?
Wix support been helpful getting me to this stage but I also need schedules , partcipant data as well.
import { bookings } from “wix-bookings-backend”;
export function get_fetch(request) {
let options = {
“headers”: {
“Content-Type”: “application/json”
}
};
let permissions = {
‘suppressAuth’ : true,
‘suppressHooks’ : true
}
return bookings
.queryBookings()
.find(permissions)
.then ((results) => {
if(results.items.length > 0 ) {
options.body = {
“items”: results.items
};
return ok(options);
}
})
.catch((error) =>{
return error;
});
}