Skip to content

Commit

Permalink
Fix lint issue
Browse files Browse the repository at this point in the history
  • Loading branch information
spaceman03 committed Sep 13, 2024
1 parent e8d372e commit 04c5484
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions apps/cms/src/admin/views/MerchProducts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ const MerchProducts: AdminViewComponent = ({ user, canAccessAdmin }) => {
if (data && data.length > 0) {
for (const key of Object.keys(new Product())) {
const renderCellComponent = RenderCellFactory.get(data[0], key);
// eslint-disable-next-line @typescript-eslint/no-floating-promises
const renderCell: React.FC<{ children?: React.ReactNode }> =
renderCellComponent instanceof Promise
? renderCellComponent
Expand Down Expand Up @@ -95,7 +94,13 @@ const MerchProducts: AdminViewComponent = ({ user, canAccessAdmin }) => {
components: {
Heading: <div>Delete</div>,
renderCell: (data: Product) => (
<Button onClick={() => handleDelete(data)}>Delete</Button>
<Button onClick={() => {
// Wrap async function call in an inline function
(async () => {

Check failure on line 99 in apps/cms/src/admin/views/MerchProducts.tsx

View workflow job for this annotation

GitHub Actions / Lint, Build and Test

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator
await handleDelete(data);
})();
}}
>Delete</Button>
),
},
label: "Delete",
Expand Down

0 comments on commit 04c5484

Please sign in to comment.