From 378cacbce08a3f2f6983cee2c60e80bec1768ab1 Mon Sep 17 00:00:00 2001 From: Tristan Fitzgerald Date: Tue, 4 Sep 2018 21:56:30 -0500 Subject: [PATCH] fix(projectAssignment): Added a default query value to me method on project assignments. Fix #114 --- src/api/projectAssignments.spec.ts | 5 ++--- src/api/projectAssignments.ts | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/api/projectAssignments.spec.ts b/src/api/projectAssignments.spec.ts index ecf32b3c..43003122 100644 --- a/src/api/projectAssignments.spec.ts +++ b/src/api/projectAssignments.spec.ts @@ -34,12 +34,11 @@ describe('ProjectAssignments test', () => { }); it('should have a me method that calls the request method', () => { - const query = { is_active: true }; - instance.me(query); + instance.me(); expect(request).toBeCalledWith( 'GET', '/v2/users/me/project_assignments', - query + {} ); }); }); diff --git a/src/api/projectAssignments.ts b/src/api/projectAssignments.ts index fd4ecb9b..0422588e 100644 --- a/src/api/projectAssignments.ts +++ b/src/api/projectAssignments.ts @@ -21,8 +21,7 @@ export class ProjectAssignmentsAPI { } // List all project assignments for the currently authenticated user - // TODO: COnsider handling defaults - public me(query: PagenationParameters) { + public me(query: PagenationParameters = {}) { return this.harvest.request( 'GET', `${this.baseUrl}/me/project_assignments`,