Skip to content

Commit

Permalink
Ensures meeting method is properly sent when fetching services
Browse files Browse the repository at this point in the history
  • Loading branch information
craigpaul committed Jan 30, 2020
1 parent 610b89c commit c680536
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/resources/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export interface ServiceFilter {
group?: number;
invitable?: number;
location?: number | string;
method?: number;
preferred?: number;
user?: number | string;
}
Expand All @@ -20,6 +21,7 @@ export interface ServiceParameters {
group?: number;
invite_only?: number;
location?: number | string;
meeting_method?: number;
preferred?: number;
user?: number | string;
}
Expand All @@ -40,6 +42,8 @@ export interface ServiceResource extends Pageable, ConditionalResource {
invitable(): this;

preferred(): this;

supporting(method: number): this;
}

export default class Service extends Conditional implements ServiceResource {
Expand Down Expand Up @@ -142,6 +146,12 @@ export default class Service extends Conditional implements ServiceResource {
return this;
}

public supporting(method: number): this {
this.filters.method = method;

return this;
}

public take(limit: number): this {
this.limit = limit;

Expand Down Expand Up @@ -171,6 +181,10 @@ export default class Service extends Conditional implements ServiceResource {
params.location = this.filters.location;
}

if (typeof this.filters.method !== 'undefined') {
params.meeting_method = this.filters.method;
}

if (typeof this.filters.preferred !== 'undefined') {
params.preferred = this.filters.preferred;
}
Expand Down

0 comments on commit c680536

Please sign in to comment.