Skip to content

Commit

Permalink
url encode sheet name to fix invalid endpoint error (#298)
Browse files Browse the repository at this point in the history
* url encode sheet name to fix invalid endpoint error

* use bracket notation for defining JSON path for Google Sheets
  • Loading branch information
shekharnwagh authored Jan 15, 2025
1 parent dc2875b commit fb788ec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions inc/Integrations/Google/Sheets/GoogleSheetsIntegration.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ private static function get_query(

return HttpQuery::from_array( [
'data_source' => $data_source,
'endpoint' => $data_source->get_endpoint() . '/values/' . $sheet['name'],
'endpoint' => $data_source->get_endpoint() . '/values/' . rawurlencode( $sheet['name'] ),
'input_schema' => $input_schema,
'output_schema' => $output_schema,
'preprocess_response' => function ( mixed $response_data, array $input_variables ): array {
Expand Down Expand Up @@ -146,7 +146,7 @@ private static function get_list_query(

return HttpQuery::from_array( [
'data_source' => $data_source,
'endpoint' => $data_source->get_endpoint() . '/values/' . $sheet['name'],
'endpoint' => $data_source->get_endpoint() . '/values/' . rawurlencode( $sheet['name'] ),
'input_schema' => [],
'output_schema' => $output_schema,
'preprocess_response' => function ( mixed $response_data ): array {
Expand Down
2 changes: 1 addition & 1 deletion src/data-sources/google-sheets/GoogleSheetsSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export const GoogleSheetsSettings = ( {
const outputQueryMappings: DataSourceQueryMappingValue[] = sheet.fields.map( field => ( {
key: field,
name: field,
path: `$.${ field }`,
path: `$["${ field }"]`,
type: 'string',
} ) );

Expand Down

0 comments on commit fb788ec

Please sign in to comment.