diff --git a/src/index.ts b/src/index.ts index 2eea7dc9..4192a5a8 100644 --- a/src/index.ts +++ b/src/index.ts @@ -13,9 +13,9 @@ import { ServerCommunicationEndpoint } from './serverCommunication'; import { TasksEndpoint } from './tasks'; import { TeamMembersEndpoint } from './teamMembers'; import { TeamsEndpoint } from './teams'; +import { TimePlanningsEndpoint } from './timeplannings'; import { TimesheetAccountingsEndpoint } from './timesheetAccountings'; import { TimeTrackingsEndpoint } from './timetrackings'; -import { TimePlanningsEndpoint } from './timeplannings'; import { TodoTasksEndpoint } from './todoTasks'; import { UsersEndpoint } from './users'; import { UserStatusOverviewsEndpoint } from './userStatusOverview'; @@ -38,9 +38,9 @@ export { ServerCommunication } from './serverCommunication/types'; export { Task, TaskCreate } from './tasks/types'; export { TeamMember } from './teamMembers/types'; export { Team } from './teams/types'; +export { TimePlanning } from './timeplannings/types'; export { TimesheetAccounting } from './timesheetAccountings/types'; export { StartTimeTrackingData, StopTimeTrackingData, TimeTracking, TimeTrackingCreate } from './timetrackings/types'; -export { TimePlanning } from './timeplannings/types'; export { TodoTask, TodoTaskCreate } from './todoTasks/types'; export { User } from './users/types'; export { UserStatusOverview } from './userStatusOverview/types'; diff --git a/src/timeplannings/timePlannings.test.ts b/src/timeplannings/timePlannings.test.ts index 38d227c9..854e98a5 100644 --- a/src/timeplannings/timePlannings.test.ts +++ b/src/timeplannings/timePlannings.test.ts @@ -1,7 +1,7 @@ import axios from 'axios'; import AxiosMockAdapter from 'axios-mock-adapter'; -import { RequestParams } from '../utils/params/requestParams'; +import { RequestParamsBuilder } from '../utils/params/requestParams'; import { TimePlanningsEndpoint } from './index'; import { TimePlanning } from './types'; @@ -39,15 +39,13 @@ describe('TimePlannings', () => { test('read with RequestParams', async () => { mock.onGet(readPath, { params: { user_id: '1', _op__user_id: 'eq' } }).reply(200, { Success: true, NumResults: 1, Results: [{}] }); - result = timePlannings.read(new RequestParams().eq('user_id', 1)); + result = timePlannings.read(new RequestParamsBuilder().eq('user_id', 1).build()); await result.then((result) => expect(result).toStrictEqual([{}])); - mock.reset(); - mock - .onGet(readPath, { params: { user_id: '1', _op__user_id: 'eq', _op__date: 'gteq' } }) + .onGet(readPath, { params: { user_id: '1', _op__user_id: 'eq', start_date: '2020-01-01', _op__start_date: 'gteq' } }) .reply(200, { Success: true, NumResults: 1, Results: [{}] }); - result = timePlannings.read(new RequestParams().eq('user_id', 1)); + result = timePlannings.read(new RequestParamsBuilder().eq('user_id', 1).gteq('start_date', '2020-01-01').build()); await result.then((result) => expect(result).toStrictEqual([{}])); });