File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -3,14 +3,14 @@ const connection = require('./db').connection;
33const logger = require ( './logger' ) ;
44const argv = require ( './db' ) . argv ;
55
6- const sql = `SELECT * FROM post ${ argv . id ? ' WHERE id = ?' : '' } `
7- const data = argv ?. id
6+ const sql = `SELECT * FROM post ${ argv . id ? ' WHERE id = ?' : '' } ` ;
7+ const data = argv ?. id ;
88
99connection . query ( sql , data , ( err , result ) => {
1010 if ( err ) {
1111 throw err ;
1212 }
13- result . forEach ( it => {
13+ result . forEach ( ( it ) => {
1414 logger . info ( '' , it ) ;
1515 } ) ;
1616} ) ;
Original file line number Diff line number Diff line change @@ -5,11 +5,11 @@ const logger = require('./logger');
55
66if ( ! argv . id ) {
77 logger . error ( `You need to specify an id` ) ;
8- process . exit ( - 1 )
8+ process . exit ( - 1 ) ;
99}
1010if ( ! ( argv . title && argv . content && argv . image ) ) {
1111 logger . error ( `You need to specify some value to change.` ) ;
12- process . exit ( - 1 )
12+ process . exit ( - 1 ) ;
1313}
1414
1515let sql = 'UPDATE post SET ' ;
You can’t perform that action at this time.
0 commit comments