File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 1
1
/* eslint-disable no-empty-pattern */
2
2
/* eslint-disable no-await-in-loop */
3
3
import { Context } from 'cordis' ;
4
- import { param , Types } from '@hydrooj/framework' ;
4
+ import { BadRequestError } from '@hydrooj/framework' ;
5
5
import { config } from '../config' ;
6
6
import { executeOnHost } from '../utils' ;
7
7
import { AuthHandler } from './misc' ;
@@ -11,8 +11,8 @@ class CommandsHandler extends AuthHandler {
11
11
this . response . body = '' ;
12
12
}
13
13
14
- @ param ( ' command' , Types . String )
15
- async postCommand ( { } , command : string ) {
14
+ async postCommand ( { command } ) {
15
+ if ( ! command || typeof command !== ' string' ) throw new BadRequestError ( 'Command' , null , 'Command is required' ) ;
16
16
this . response . body = this . executeForAll ( command ) ;
17
17
}
18
18
You can’t perform that action at this time.
0 commit comments