Skip to content

Commit

Permalink
Allows the source of the appointment to be set (ie. the UTM source)
Browse files Browse the repository at this point in the history
  • Loading branch information
willik committed Sep 30, 2019
1 parent dc0ba2d commit 70b42b7
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/resources/appointment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export interface AppointmentFilter {
matchers?: AppointmentMatcherParameters;
notifications?: AppointmentNotificationParameters;
services?: number | number[];
source?: string;
start?: string;
user?: number;
}
Expand Down Expand Up @@ -46,6 +47,7 @@ export interface AppointmentParameters {
client?: boolean;
user?: boolean;
};
source?: string;
};
}

Expand All @@ -66,6 +68,8 @@ export interface AppointmentResource extends Resource, ConditionalResource {

starting(start: string): this;

source(source: string): this;

via(invitation: number): this;

with(attendees: AttendeeModel | AttendeeModel[]): this;
Expand Down Expand Up @@ -140,6 +144,12 @@ export default class Appointment extends Conditional implements AppointmentResou
return this;
}

public source(source: string): this {
this.filters.source = source;

return this;
}

public via(invitation: number): this {
this.filters.invitation = invitation;

Expand Down Expand Up @@ -201,6 +211,16 @@ export default class Appointment extends Conditional implements AppointmentResou
};
}

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

return params;
}
}

0 comments on commit 70b42b7

Please sign in to comment.