Skip to content

Commit b7ee23e

Browse files
authored
Merge pull request #11 from jojojojojota/feature/controller_methods
Correctif pour eviter les problème de fonction non définie
2 parents ffba6ae + 81b703d commit b7ee23e

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

src/app/controller.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@ export default class controller{
1212
this.params = request.params;
1313
this.session = request.session;
1414
// @ts-ignore
15-
this[fun]();
15+
if(!this[fun]){
16+
this.index();
17+
} else {
18+
// @ts-ignore
19+
this[fun]();
20+
}
1621
}
1722

1823
index(){

src/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export default [
2-
{path: "/", controller: "indexController::index", type: "get"},
2+
{path: "/", controller: "indexController", type: "get"},
33
{path: "/test", controller: "indexController::test", type: "get"},
44
//{path: "/session", controller: "sessionController", type: "get"}
55
]

0 commit comments

Comments
 (0)