rusackas commented on code in PR #37625:
URL: https://github.com/apache/superset/pull/37625#discussion_r2771439184


##########
superset-frontend/src/explore/components/ExploreChartHeader/index.tsx:
##########
@@ -155,23 +176,23 @@ export const ExploreChartHeader = ({
   };
 
   const updateSlice = useCallback(
-    slice => {
-      dispatch(sliceUpdated(slice));
+    (updatedSlice: Slice) => {
+      dispatch(sliceUpdated(updatedSlice));
     },
     [dispatch],
   );
 
-  const handleReportDelete = async report => {
-    await dispatch(deleteActiveReport(report));
+  const handleReportDelete = async (report: AlertObject) => {
+    await dispatch(deleteActiveReport(report as unknown as ReportObject));

Review Comment:
   Fixed in b1a3ce4e84. The root cause was that `HeaderReportDropdown` was 
incorrectly typing Redux data as `AlertObject` when it's actually 
`ReportObject`. Fixed by:
   - Changing the selector type from `AlertObject` to `ReportObject`
   - Updating `setCurrentReportDeleting` callback type throughout the chain
   - Removing the `as unknown as ReportObject` cast entirely
   
   Also added a minimal `DeletableReport` interface for `deleteActiveReport` 
since it only uses `id` and `name` fields.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to