Skip to content

Commit 9c4fc80

Browse files
committed
Updated BaseController to inherit from Grind’s build in controller
1 parent 2d1162f commit 9c4fc80

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

app/Controllers/BaseController.js

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
export class BaseController {
2-
app = null
1+
import {Controller} from 'grind-framework'
2+
3+
export class BaseController extends Controller {
34
db = null
45

56
constructor(app) {
6-
this.app = app
7+
super(app)
8+
79
this.db = app.get('db')
810
}
911

@@ -14,14 +16,4 @@ export class BaseController {
1416
return { limit, offset }
1517
}
1618

17-
abort(code, message, next) {
18-
const error = HttpError.make(code, message)
19-
20-
if(next.isNil) {
21-
throw error
22-
}
23-
24-
next(error)
25-
}
26-
2719
}

0 commit comments

Comments
 (0)