-
-
Notifications
You must be signed in to change notification settings - Fork 638
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow defining actions for make:controller command
- Loading branch information
1 parent
e2d03e1
commit d6a29fe
Showing
4 changed files
with
165 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{{#var controllerName = generators.controllerName(entity.name)}} | ||
{{#var controllerFileName = generators.controllerFileName(entity.name)}} | ||
{{{ | ||
exports({ | ||
to: app.httpControllersPath(entity.path, controllerFileName) | ||
}) | ||
}}} | ||
import type { HttpContext } from '@adonisjs/core/http' | ||
|
||
export default class {{ controllerName }} { | ||
{{#each actions as action}} | ||
async {{action}}({}: HttpContext) {} | ||
{{/each}} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters