Skip to content

fix: Info panel item panel calls Cloud Code with parameter objectId instead of Parse.Object and without masterKey #2649

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading