Skip to content

Commit

Permalink
fix(calendarEvents): fix post request for searching within groups
Browse files Browse the repository at this point in the history
* fixes for GWP-6481
* changes to calendarEvents, removing calendarEvent
* CalendarEvent type changes
  • Loading branch information
solomon-gumball authored and inv8der committed Nov 3, 2016
1 parent a8daecb commit ad8051e
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 221 deletions.
65 changes: 0 additions & 65 deletions src/api/calendarEvent/calendarEvent-schema.json

This file was deleted.

88 changes: 0 additions & 88 deletions src/api/calendarEvent/index.js

This file was deleted.

54 changes: 0 additions & 54 deletions src/api/calendarEvent/types.js

This file was deleted.

27 changes: 16 additions & 11 deletions src/api/calendarEvents/types.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
// @flow

export type CalendarEvent = {
name: string,
id: number,
parent_id: number,
parent: Object,
organization_id: number,
member_count: number,
owners: Array<Object>,
sub_groups: Array<Object>,
organization_data: Array<Object>;
customer_id: number,
ticket?: {
id: number,
start_date: string,
due_date: string
},
summary: ?string,
description: ?string,
start: string,
end: string,
recurrence: ?string,
event_type: string,
generated: boolean
}

type CalendarEventField = {
Expand Down Expand Up @@ -43,9 +48,9 @@ type GetCalendarEventsForCustomerQuery = {
time_min: string,
time_max: string,
time_zone: string,
event_type: 'TICKET_SCHEDULE' | 'BLOCK',
offset: number,
limit: number
event_type?: 'TICKET_SCHEDULE' | 'BLOCK',
offset?: number,
limit?: number
}

export type GetCalendarEventsForCustomerParams = {
Expand Down
6 changes: 3 additions & 3 deletions src/api/tickets/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ export default class Tickets extends Resource {
* gigwalk.tickets.searchForGroup({...})
*/
searchForGroup(params: SearchGroupTicketsParams): APIPromise<Array<ESTicket>> {
const query = this.stringForQueryObject(params.query);
const queryParams = this.stringForQueryObject(params.query_params);
const data = {
query_params: params.query_params,
query: params.query,
bounding_box: params.bounding_box,
timezone: params.timezone
};

return this.client.post(`/v1/groups/${params.group_id}/tickets/search${query}`, data);
return this.client.post(`/v1/groups/${params.group_id}/tickets/search${queryParams}`, data);
}

/**
Expand Down

0 comments on commit ad8051e

Please sign in to comment.