Skip to content

Commit

Permalink
do not use showColumns for every Module.get API method, just to be su…
Browse files Browse the repository at this point in the history
…re no other core bugs surface
  • Loading branch information
diosmosis committed Oct 4, 2024
1 parent 8db5015 commit f3f2ea4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,16 +225,16 @@ function getReportData(request: GoogleAppsScript.Data_Studio.Request<ConnectorPa
}

const SHOW_COLUMNS_UNSUPPORTED_METHODS = [
'API.get', // only works for some metrics
'VisitFrequency.get',
'Contents.getContentPieces',
'Contents.getContentNames',
'Actions.getPageUrlsFollowingSiteSearch',
];

let showColumns;
// showColumns does not work correctly with some API methods
if (!SHOW_COLUMNS_UNSUPPORTED_METHODS.includes(apiMethod)) {
if (!SHOW_COLUMNS_UNSUPPORTED_METHODS.includes(apiMethod)
&& reportParams.apiAction !== 'get' // showColumns does not work for API methods like API.get or VisitFrequency.get
) {
showColumns = (requestedFields.map(({name}) => name)).join(',');
}

Expand Down

0 comments on commit f3f2ea4

Please sign in to comment.