> ## Documentation Index
> Fetch the complete documentation index at: https://gadget.aurelienbbn.com/llms.txt
> Use this file to discover all available pages before exploring further.

# action-no-empty-on-success

> Disallow empty onSuccess exports in Gadget actions.

| Recommended                                  | Strict                                     | Auto-fixable                                | Scope               |
| -------------------------------------------- | ------------------------------------------ | ------------------------------------------- | ------------------- |
| <Badge color="orange" size="sm">warn</Badge> | <Badge color="red" size="sm">error</Badge> | <Badge color="green" size="sm">true</Badge> | Gadget action files |

**What the linter reports:**

> Remove empty onSuccess.

## Examples

<Tabs>
  <Tab title="Incorrect">
    ```ts title="api/models/widget/actions/create.ts" theme={null}
    // empty onSuccess adds overhead without doing anything
    export const onSuccess: ActionOnSuccess = async () => {};
    ```
  </Tab>

  <Tab title="Correct">
    ```ts title="api/models/widget/actions/create.ts" theme={null}
    export const onSuccess: ActionOnSuccess = async ({ record }) => {
      // onSuccess must contain at least one statement, or be omitted entirely
      await doSomething(record);
    };
    ```
  </Tab>
</Tabs>
