Skip to content

Commit

Permalink
fix: Info panel item panel calls Cloud Code with parameter `objectI…
Browse files Browse the repository at this point in the history
…d` instead of `Parse.Object` and without `masterKey` (#2649)
  • Loading branch information
mtrezza authored Feb 1, 2025
1 parent 81c9c77 commit 884ff70
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
13 changes: 10 additions & 3 deletions src/components/AggregationPanel/AggregationPanel.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import LoaderDots from 'components/LoaderDots/LoaderDots.react';
import Parse from 'parse';
import React, { useCallback, useEffect, useMemo, useState } from 'react';
import styles from './AggregationPanel.scss';
import Parse from 'parse';
import {
AudioElement,
ButtonElement,
Expand All @@ -21,6 +21,7 @@ const AggregationPanel = ({
showNote,
setSelectedObjectId,
selectedObjectId,
className,
appName,
depth = 0,
cloudCodeFunction = null,
Expand Down Expand Up @@ -52,8 +53,13 @@ const AggregationPanel = ({
const fetchNestedData = useCallback(async () => {
setIsLoadingNested(true);
try {
const params = { objectId: selectedObjectId };
const result = await Parse.Cloud.run(cloudCodeFunction, params);
const params = {
object: Parse.Object.extend(className).createWithoutData(selectedObjectId).toPointer(),
};
const options = {
useMasterKey: true,
};
const result = await Parse.Cloud.run(cloudCodeFunction, params, options);
if (result?.panel?.segments) {
setNestedData(result);
} else {
Expand Down Expand Up @@ -113,6 +119,7 @@ const AggregationPanel = ({
showNote={showNote}
setSelectedObjectId={setSelectedObjectId}
selectedObjectId={selectedObjectId}
className={className}
depth={depth + 1}
cloudCodeFunction={item.cloudCodeFunction}
panelTitle={item.title}
Expand Down
2 changes: 1 addition & 1 deletion src/dashboard/Data/Browser/Browser.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ class Browser extends DashboardView {
};
const options = {
useMasterKey: true,
}
};
const appName = this.props.params.appId;
const cloudCodeFunction = this.state.classwiseCloudFunctions[`${appId}${appName}`]?.[className][0].cloudCodeFunction;
Parse.Cloud.run(cloudCodeFunction, params, options).then(
Expand Down
1 change: 1 addition & 0 deletions src/dashboard/Data/Browser/DataBrowser.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,7 @@ export default class DataBrowser extends React.Component {
setSelectedObjectId={this.setSelectedObjectId}
selectedObjectId={this.state.selectedObjectId}
appName = {this.props.appName}
className = {this.props.className}
/>
</div>
</ResizableBox>
Expand Down

0 comments on commit 884ff70

Please sign in to comment.