This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Creates a query to retrieve a list of reservation locations.
The queryReservationLocations()
function builds a query to retrieve a list of reservation locations and returns a ReservationLocationsQueryBuilder
object.
The returned object contains the query definition, which is used to run the query using the find() function.
You can refine the query by chaining ReservationLocationsQueryBuilder
functions onto the query. ReservationLocationsQueryBuilder
functions enable you to filter, sort, and control the results that queryReservationLocations()
returns.
queryReservationLocations()
runs with the following ReservationLocationsQueryBuilder
defaults, which you can override:
The following ReservationLocationsQueryBuilder
functions are supported for queryReservationLocations()
. For a full description of the reservation location object, see the object returned for the items
property in ReservationLocationsQueryResult
.
PROPERTY | SUPPORTED FILTERS & SORTING |
---|---|
_id | eq() ,ne() ,in() |
function queryReservationLocations(
options: QueryReservationLocationsOptions,
): ReservationLocationsQueryBuilder;
An object representing the available options for querying reservation locations.
import { reservationLocations } from "wix-table-reservations-v2";
reservationLocations
.queryReservationLocations()
.find()
.then((retrievedReservationLocations) => {
const nextCursor = retrievedReservationLocations._nextCursor;
const minNotice =
retrievedReservationLocations._items[0].configuration.onlineReservations
.minimumReservationNotice;
console.log(
"Success! Retrieved reservation locations from query:",
retrievedReservationLocations,
);
return retrievedReservationLocations;
})
.catch((error) => {
console.error(error);
// Handle the error
});
/* Promise resolves to:
* {
* "_items": [
* {
* "location": {
* "name": "Yunitsman Street",
* "fax": "",
* "timeZone": "Europe/Dublin",
* "email": "",
* "phone": "",
* "address": {
* "formatted": "Yunitsman Street 5, Tel Aviv-Yafo, Israel",
* "location": {
* "latitude": 32.141816,
* "longitude": 34.7987383
* },
* "streetAddress": {
* "name": "Yunitsman Street",
* "number": "5",
* "apt": ""
* },
* "city": "Tel Aviv-Yafo",
* "subdivision": "",
* "country": "IL",
* "postalCode": ""
* },
* "businessSchedule": {
* "periods": [
* {
* "openDay": "SUNDAY",
* "openTime": "00:00",
* "closeDay": "MONDAY",
* "closeTime": "00:00"
* },
* {
* "openDay": "THURSDAY",
* "openTime": "00:00",
* "closeDay": "SUNDAY",
* "closeTime": "00:00"
* }
* ],
* "specialHourPeriod": []
* },
* "_id": "9bd42376-12c2-483e-86c3-8ee685e718e1"
* },
* "configuration": {
* "onlineReservations": {
* "partiesSize": {
* "min": 1,
* "max": 6
* },
* "minimumReservationNotice": {
* "number": 15,
* "unit": "MINUTES"
* },
* "turnoverTimeRules": [],
* "turnoverRules": [],
* "onlineReservationsEnabled": true
* },
* "myReservationsFields": []
* },
* "default": false,
* "archived": false,
* "_id": "800c581a-1942-4079-8198-2eee44463eb7"
* },
* {
* "location": {
* "name": "Nemal Tel Aviv Street",
* "fax": "",
* "timeZone": "Europe/Dublin",
* "email": "",
* "phone": "",
* "address": {
* "formatted": "Tel Aviv Port, Nemal Tel Aviv Street, Tel Aviv, Israel",
* "location": {
* "latitude": 32.0972612,
* "longitude": 34.77376549999999
* },
* "streetAddress": {
* "name": "Nemal Tel Aviv Street",
* "number": "",
* "apt": ""
* },
* "city": "Tel Aviv-Yafo",
* "country": "IL"
* },
* "businessSchedule": {
* "periods": [
* {
* "openDay": "SUNDAY",
* "openTime": "00:00",
* "closeDay": "MONDAY",
* "closeTime": "00:00"
* },
* {
* "openDay": "THURSDAY",
* "openTime": "00:00",
* "closeDay": "SUNDAY",
* "closeTime": "00:00"
* }
* ],
* "specialHourPeriod": []
* },
* "_id": "f1f59093-6842-45a4-b9d1-106429ec8313"
* },
* "configuration": {
* "onlineReservations": {
* "partiesSize": {
* "min": 1,
* "max": 6
* },
* "minimumReservationNotice": {
* "number": 15,
* "unit": "MINUTES"
* },
* "turnoverTimeRules": [],
* "turnoverRules": [],
* "businessSchedule": {
* "periods": [
* {
* "openDay": "SUNDAY",
* "openTime": "00:00",
* "closeDay": "TUESDAY",
* "closeTime": "00:00"
* },
* {
* "openDay": "WEDNESDAY",
* "openTime": "00:00",
* "closeDay": "THURSDAY",
* "closeTime": "00:00"
* },
* {
* "openDay": "FRIDAY",
* "openTime": "00:00",
* "closeDay": "SUNDAY",
* "closeTime": "00:00"
* }
* ],
* "specialHourPeriod": []
* },
* "onlineReservationsEnabled": true
* },
* "reservationForm": {
* "customFieldDefinitions": [
* {
* "name": "Allergies",
* "required": false,
* "_id": "f4283b2d-6340-4cf9-bae7-8769e6b62127"
* }
* ]
* },
* "myReservationsFields": []
* },
* "default": true,
* "archived": false,
* "_id": "fab8cc1f-31cf-462f-b5bb-392594624bf2"
* }
* ],
* "_originQuery": {
* "filterTree": {
* "$and": []
* },
* "invalidArguments": [],
* "encoder": {},
* "transformationPaths": {},
* "sort": [],
* "paging": {},
* "pagingMethod": "CURSOR",
* "builderOptions": {
* "cursorWithEmptyFilterAndSort": true
* }
* },
* "_limit": 50,
* "_nextCursor": "",
* "_prevCursor": "",
* "cursors": {
* "next": "",
* "prev": ""
* }
* }
*/
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.