@@ -41,8 +41,8 @@ app.set('views', path.join(__dirname, 'views'));
41
41
app . set ( 'view engine' , 'ejs' ) ;
42
42
app . use ( express . static ( 'uploads' ) ) ;
43
43
44
- app . get ( '/' , function ( req , res ) {
45
- Detail . find ( { } , function ( err , data ) {
44
+ app . get ( '/' , ( req , res ) => {
45
+ Detail . find ( { } , ( err , data ) => {
46
46
if ( err ) {
47
47
console . log ( err ) ;
48
48
} else {
@@ -52,7 +52,7 @@ app.get('/', function(req, res){
52
52
53
53
} ) ;
54
54
55
- app . post ( '/' , upload . any ( ) , function ( req , res ) {
55
+ app . post ( '/' , upload . any ( ) , ( req , res ) => {
56
56
57
57
// console.log("req.body"); //form fields
58
58
// console.log(req.body);
@@ -63,7 +63,7 @@ app.post('/', upload.any(), function(req,res){
63
63
res . json ( { success : false } ) ;
64
64
} else {
65
65
var c ;
66
- Detail . findOne ( { } , function ( err , data ) {
66
+ Detail . findOne ( { } , ( err , data ) => {
67
67
// console.log("into detail");
68
68
69
69
if ( data ) {
@@ -80,7 +80,7 @@ app.post('/', upload.any(), function(req,res){
80
80
image2 : req . files [ 1 ] && req . files [ 1 ] . filename ? req . files [ 1 ] . filename : '' ,
81
81
} ) ;
82
82
83
- detail . save ( function ( err , Person ) {
83
+ detail . save ( ( err , Person ) => {
84
84
if ( err )
85
85
console . log ( err ) ;
86
86
else
@@ -93,9 +93,9 @@ app.post('/', upload.any(), function(req,res){
93
93
}
94
94
} ) ;
95
95
96
- app . post ( '/delete' , function ( req , res ) {
96
+ app . post ( '/delete' , ( req , res ) => {
97
97
98
- Detail . findByIdAndRemove ( req . body . prodId , function ( err , data ) {
98
+ Detail . findByIdAndRemove ( req . body . prodId , ( err , data ) => {
99
99
100
100
console . log ( data ) ;
101
101
@@ -104,4 +104,4 @@ app.post('/delete',function(req,res){
104
104
} ) ;
105
105
106
106
var port = 2000 ;
107
- app . listen ( port , function ( ) { console . log ( 'listening on port ' + port ) ; } ) ;
107
+ app . listen ( port , ( ) => { console . log ( 'listening on port ' + port ) ; } ) ;
0 commit comments