Skip to content

Commit

Permalink
Ensures booker will be sent when making a booking
Browse files Browse the repository at this point in the history
  • Loading branch information
craigpaul committed Nov 26, 2019
1 parent ff40f1f commit 5b96f21
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/resources/appointment.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ it('can book an appointment with all available parameters', async () => {
.medium('test medium')
.source('test source')
.term('test term')
.actingAs(10)
.with(
attendee
.named('Jane', 'Doe')
Expand Down Expand Up @@ -269,6 +270,7 @@ it('can book an appointment with all available parameters', async () => {
type: 'appointments',
},
meta: {
booker: 10,
notify: notification,
utm: {
campaign: 'test campaign',
Expand Down
11 changes: 11 additions & 0 deletions src/resources/appointment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export interface AppointmentParameters {
type: string;
};
meta?: {
booker?: number;
notify?: {
client?: boolean;
user?: boolean;
Expand Down Expand Up @@ -343,6 +344,16 @@ export default class Appointment extends Conditional implements AppointmentResou
};
}

if (this.meta.booker) {
params = {
...params,
meta: {
...params.meta,
booker: this.meta.booker,
}
}
}

return params;
}

Expand Down

0 comments on commit 5b96f21

Please sign in to comment.