Skip to content
Snippets Groups Projects

Limit to a given user, and improve feedback

Merged Erick Hitter requested to merge develop into master
1 file
+ 7
2
Compare changes
  • Side-by-side
  • Inline
+ 7
2
@@ -28,7 +28,12 @@ app.get( '/', function( req, res ) {
app.post( '/log', function( req, res ) {
// Don't bother if there's nothing to record
if ( 'undefined' === typeof req.body || 'undefined' === typeof req.body.text || ! req.body.text.length ) {
return res.sendStatus( 400 );
var response = {
"response_type": "ephemeral",
"text": "Please provide something to record."
};
return res.status( 400 ).send( response );
}
// Limit who can trigger the command
@@ -38,7 +43,7 @@ app.post( '/log', function( req, res ) {
"text": "Sorry, you can't record completed tasks."
};
return res.send( response );
return res.status( 403 ).send( response );
}
// Massage the title
Loading