Skip to content

Commit f9f4b8d

Browse files
author
Michelle Bergeron
committed
updates to book-appointment
1 parent 1b6fdcc commit f9f4b8d

2 files changed

Lines changed: 12 additions & 7 deletions

File tree

components/mindbody/actions/book-appointment/book-appointment.mjs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export default {
4444
staffId: {
4545
type: "string",
4646
label: "Staff ID",
47-
description: "The staff member (instructor/therapist) who will deliver the service. Use **List Staff** to find IDs.",
47+
description: "The staff member (instructor/therapist) who will deliver the service. Staff member must be an instructor for the requested service. Use **List Staff** to find IDs.",
4848
},
4949
notes: {
5050
type: "string",
@@ -57,18 +57,22 @@ export default {
5757
const body = {
5858
ClientId: this.clientId,
5959
LocationId: this.locationId,
60-
SessionTypeId: this.sessionTypeId,
61-
StartDateTime: this.startDateTime,
62-
StaffId: this.staffId,
63-
Notes: this.notes,
60+
ItineraryEvents: [
61+
{
62+
SessionTypeId: this.sessionTypeId,
63+
StartDateTime: this.startDateTime,
64+
StaffId: this.staffId,
65+
Notes: this.notes,
66+
},
67+
],
6468
};
6569

6670
const response = await this.app.addAppointment({
6771
$,
6872
data: body,
6973
});
70-
const appt = response.Appointment || {};
71-
$.export("$summary", `Booked appointment ${appt.Id} for client ${this.clientId} on ${this.startDateTime}`);
74+
const appt = response?.Itinerary?.[0] || {};
75+
$.export("$summary", `Booked appointment ${appt?.Id} for client ${this.clientId} on ${this.startDateTime}`);
7276
return response;
7377
},
7478
};

components/mindbody/mindbody.app.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ export default {
6363
headers: this._headers(),
6464
params,
6565
data,
66+
debug: true,
6667
});
6768
},
6869
getSiteInfo(opts = {}) {

0 commit comments

Comments
 (0)