Skip to content

Commit ddece36

Browse files
committed
fix(google-calendar): wire list q/pageToken into block, harden invite PUT error parse
1 parent 9ec7c80 commit ddece36

2 files changed

Lines changed: 22 additions & 2 deletions

File tree

apps/sim/blocks/blocks/google_calendar.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,24 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`,
271271
generationType: 'timestamp',
272272
},
273273
},
274+
{
275+
id: 'q',
276+
title: 'Search Query',
277+
type: 'short-input',
278+
placeholder: 'standup',
279+
condition: { field: 'operation', value: 'list' },
280+
},
281+
{
282+
id: 'pageToken',
283+
title: 'Page Token',
284+
type: 'short-input',
285+
placeholder: 'Token from a previous response (nextPageToken)',
286+
condition: {
287+
field: 'operation',
288+
value: ['list', 'instances', 'list_calendars', 'list_acl'],
289+
},
290+
mode: 'advanced',
291+
},
274292

275293
{
276294
id: 'eventId',
@@ -818,7 +836,9 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`,
818836

819837
timeMin: { type: 'string', description: 'Start time filter' },
820838
timeMax: { type: 'string', description: 'End time filter' },
839+
q: { type: 'string', description: 'Free-text search query' },
821840
maxResults: { type: 'string', description: 'Maximum number of results' },
841+
pageToken: { type: 'string', description: 'Pagination token from a previous response' },
822842

823843
calendarIds: { type: 'string', description: 'Comma-separated calendar IDs' },
824844

apps/sim/tools/google_calendar/invite.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ async function inviteAttendees(
8484
})
8585

8686
if (!putResponse.ok) {
87-
const errorData = await putResponse.json()
88-
throw new Error(errorData.error?.message || 'Failed to invite attendees to calendar event')
87+
const errorData = await putResponse.json().catch(() => null)
88+
throw new Error(errorData?.error?.message || 'Failed to invite attendees to calendar event')
8989
}
9090

9191
const data: GoogleCalendarApiEventResponse = await putResponse.json()

0 commit comments

Comments
 (0)