File tree 1 file changed +5
-7
lines changed
1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -17,18 +17,15 @@ const folderName = 'img-story'; //nama-folder
17
17
module . exports = {
18
18
getAllStory : async ( req , res , next ) => {
19
19
try {
20
- const Story = await story . findAll ( {
21
- // where: {
22
- // user: req.user.id,
23
- // },
24
- } ) ;
20
+ const Story = await story . findAll ( ) ;
25
21
26
22
res . status ( 200 ) . json ( {
27
23
message : 'Success get All My Story' ,
28
24
data : Story ,
29
25
} ) ;
30
26
} catch ( error ) {
31
- next ( error ) ;
27
+ console . error ( error ) ;
28
+ res . status ( 500 ) . json ( { message : 'Server error' } ) ;
32
29
}
33
30
} ,
34
31
getStoryById : async ( req , res , next ) => {
@@ -42,7 +39,8 @@ module.exports = {
42
39
data : Story ,
43
40
} ) ;
44
41
} catch ( error ) {
45
- next ( error ) ;
42
+ console . error ( error ) ;
43
+ res . status ( 500 ) . json ( { message : 'Server error' } ) ;
46
44
}
47
45
} ,
48
46
getDataLocationGunung : async ( req , res ) => {
You can’t perform that action at this time.
0 commit comments