Skip to content

Commit

Permalink
fix onclick
Browse files Browse the repository at this point in the history
  • Loading branch information
AdityaJ2305 committed Dec 24, 2024
1 parent 6bc0559 commit e64ff5a
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/components/Common/Export.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,19 @@ function ExportMenuItem({
return (
<DropdownMenuItem
onClick={() => {
let action = item.action;
if (item.route) {
action = async () => {
const { data } = await request(item.route!);
return data ?? null;
};
}
if (action) {
if (item.action) {
let action = item.action;
if (item.route) {
action = async () => {
const { data } = await request(item.route!);
return data ?? null;
};
}
exportFile(action, item.filePrefix, item.type, item.parse);
} else if (item.options?.onClick) {
item.options.onClick();
}
}}
disabled={item.options?.disabled || !isAuthorized}
id={item.options?.id}
className={item.options?.className}
>
<div>
Expand Down

0 comments on commit e64ff5a

Please sign in to comment.