Skip to content

Commit

Permalink
fix(projectAssignment): Added a default query value to me method on p…
Browse files Browse the repository at this point in the history
…roject assignments.

Fix #114
  • Loading branch information
simplyspoke committed Sep 5, 2018
1 parent 44f0fd4 commit 378cacb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
5 changes: 2 additions & 3 deletions src/api/projectAssignments.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
{}
);
});
});
3 changes: 1 addition & 2 deletions src/api/projectAssignments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`,
Expand Down

0 comments on commit 378cacb

Please sign in to comment.