What the linter reports:
onSuccess requires a run export.
Examples
- Incorrect
- Correct
api/models/widget/actions/create.ts
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Require a run export when onSuccess is exported in Gadget actions.
| Recommended | Strict | Auto-fixable | Scope |
|---|---|---|---|
| warn | error | false | Gadget action files |
onSuccess requires a run export.
// onSuccess cannot exist without a run export
export const onSuccess: ActionOnSuccess = async ({ record }) => {
await doSomething(record);
};
// run must be defined alongside onSuccess
export const run: ActionRun = async ({ params }) => {};
export const onSuccess: ActionOnSuccess = async ({ record }) => {
await doSomething(record);
};
Was this page helpful?