mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-20 16:42:56 +00:00
refactor: use constructor for checking error type in SCRoute
change SCRouteHttpVerbs from type to enum
This commit is contained in:
@@ -12,7 +12,15 @@
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {SCAbstractRoute} from '../../../Route';
|
||||
import {SCAbstractRoute, SCRouteHttpVerbs} from '../../../Route';
|
||||
import {
|
||||
SCInternalServerErrorResponse,
|
||||
SCMethodNotAllowedErrorResponse,
|
||||
SCSyntaxErrorResponse,
|
||||
SCTooManyRequestsErrorResponse,
|
||||
SCUnsupportedMediaTypeErrorResponse,
|
||||
SCValidationErrorResponse,
|
||||
} from '../../errors/ErrorResponse';
|
||||
import {SCSearchQuery} from './SearchRequest';
|
||||
|
||||
/**
|
||||
@@ -35,14 +43,14 @@ export class SCMultiSearchRoute extends SCAbstractRoute {
|
||||
constructor() {
|
||||
super();
|
||||
this.errorNames = [
|
||||
'SCInternalServerErrorResponse',
|
||||
'SCMethodNotAllowedErrorResponse',
|
||||
'SCSyntaxError',
|
||||
'SCTooManyRequestsErrorResponse',
|
||||
'SCUnsupportedMediaTypeErrorResponse',
|
||||
'SCValidationErrorResponse',
|
||||
SCInternalServerErrorResponse,
|
||||
SCMethodNotAllowedErrorResponse,
|
||||
SCSyntaxErrorResponse,
|
||||
SCTooManyRequestsErrorResponse,
|
||||
SCUnsupportedMediaTypeErrorResponse,
|
||||
SCValidationErrorResponse,
|
||||
];
|
||||
this.method = 'POST';
|
||||
this.method = SCRouteHttpVerbs.POST;
|
||||
this.requestBodyName = 'SCMultiSearchRequest';
|
||||
this.responseBodyName = 'SCMultiSearchResponse';
|
||||
this.statusCodeSuccess = 200;
|
||||
|
||||
Reference in New Issue
Block a user