getBookings() is forbidden

Hi,
This is the issue:

backend code:
import { bookings } from “wix-bookings-backend”;

export function getMyBookings() {
return bookings.queryBookings().find();
}

page code:
import { getMyBookings } from “backend/booking”;

$w.onReady(function () {
getMyBookings()
.then((results) => {
console.log("# " + JSON.stringify(results));
})
.catch((err) =>{
console.log(err);
})
})

result:

Thanks a lot:)
Dafna

Hey Dafna, try to use async-await

export async function getMyBookings() {
    return await bookings.queryBookings().find();
}

Or:

export function getMyBookings() {
   return bookings.queryBookings()
    .find()
    .then((results) => {
        return results
     })
}

Let me know if it’s solved the issue.

B.