File tree 2 files changed +7
-7
lines changed
2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -8,15 +8,15 @@ abstract class BaseCtrl {
8
8
if ( err ) { return console . error ( err ) ; }
9
9
res . json ( docs ) ;
10
10
} ) ;
11
- }
11
+ } ;
12
12
13
13
// Count all
14
14
count = ( req , res ) => {
15
15
this . model . count ( ( err , count ) => {
16
16
if ( err ) { return console . error ( err ) ; }
17
17
res . json ( count ) ;
18
18
} ) ;
19
- }
19
+ } ;
20
20
21
21
// Insert
22
22
insert = ( req , res ) => {
@@ -31,31 +31,31 @@ abstract class BaseCtrl {
31
31
}
32
32
res . status ( 200 ) . json ( item ) ;
33
33
} ) ;
34
- }
34
+ } ;
35
35
36
36
// Get by id
37
37
get = ( req , res ) => {
38
38
this . model . findOne ( { _id : req . params . id } , ( err , obj ) => {
39
39
if ( err ) { return console . error ( err ) ; }
40
40
res . json ( obj ) ;
41
41
} ) ;
42
- }
42
+ } ;
43
43
44
44
// Update by id
45
45
update = ( req , res ) => {
46
46
this . model . findOneAndUpdate ( { _id : req . params . id } , req . body , ( err ) => {
47
47
if ( err ) { return console . error ( err ) ; }
48
48
res . sendStatus ( 200 ) ;
49
49
} ) ;
50
- }
50
+ } ;
51
51
52
52
// Delete by id
53
53
delete = ( req , res ) => {
54
54
this . model . findOneAndRemove ( { _id : req . params . id } , ( err ) => {
55
55
if ( err ) { return console . error ( err ) ; }
56
56
res . sendStatus ( 200 ) ;
57
57
} ) ;
58
- }
58
+ } ;
59
59
}
60
60
61
61
export default BaseCtrl ;
Original file line number Diff line number Diff line change @@ -16,6 +16,6 @@ export default class UserCtrl extends BaseCtrl {
16
16
res . status ( 200 ) . json ( { token : token } ) ;
17
17
} ) ;
18
18
} ) ;
19
- }
19
+ } ;
20
20
21
21
}
You can’t perform that action at this time.
0 commit comments