Skip to content

Commit

Permalink
Adds required code parameter to cancel an appointment
Browse files Browse the repository at this point in the history
  • Loading branch information
craigpaul committed Oct 20, 2020
1 parent 0070694 commit b556d27
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/resources/appointment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export interface AppointmentResource extends Resource, ConditionalResource {

by(user: number): this;

cancel(appointment: number, attendee: number): Promise<any>;
cancel(appointment: number, attendee: number, code: string): Promise<any>;

for(services: number | number[]): this;

Expand Down Expand Up @@ -226,8 +226,11 @@ export default class Appointment extends Conditional implements AppointmentResou
return this;
}

public async cancel(appointment: number, attendee: number): Promise<any> {
return await this.client.delete(`appointments/${appointment}/${attendee}`, { data: this.params() });
public async cancel(appointment: number, attendee: number, code: string): Promise<any> {
return await this.client.delete(`appointments/${appointment}/${attendee}`, {
data: this.params(),
params: { code },
});
}

public content(content: string): this {
Expand Down

0 comments on commit b556d27

Please sign in to comment.