mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-10 11:42:59 +00:00
refactor: use constructor for checking error type in SCRoute
change SCRouteHttpVerbs from type to enum
This commit is contained in:
@@ -12,9 +12,16 @@
|
||||
* 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 {SCSearchFilter} from '../../../types/filters/Abstract';
|
||||
import {SCSearchSort} from '../../../types/sorts/Abstract';
|
||||
import {
|
||||
SCInternalServerErrorResponse,
|
||||
SCMethodNotAllowedErrorResponse,
|
||||
SCSyntaxErrorResponse,
|
||||
SCUnsupportedMediaTypeErrorResponse,
|
||||
SCValidationErrorResponse,
|
||||
} from '../../errors/ErrorResponse';
|
||||
|
||||
/**
|
||||
* A search request
|
||||
@@ -61,13 +68,13 @@ export class SCSearchRoute extends SCAbstractRoute {
|
||||
constructor() {
|
||||
super();
|
||||
this.errorNames = [
|
||||
'SCInternalServerErrorResponse',
|
||||
'SCMethodNotAllowedErrorResponse',
|
||||
'SCSyntaxError',
|
||||
'SCUnsupportedMediaTypeErrorResponse',
|
||||
'SCValidationErrorResponse',
|
||||
SCInternalServerErrorResponse,
|
||||
SCMethodNotAllowedErrorResponse,
|
||||
SCSyntaxErrorResponse,
|
||||
SCUnsupportedMediaTypeErrorResponse,
|
||||
SCValidationErrorResponse,
|
||||
];
|
||||
this.method = 'POST';
|
||||
this.method = SCRouteHttpVerbs.POST;
|
||||
this.requestBodyName = 'SCSearchRequest';
|
||||
this.responseBodyName = 'SCSearchResponse';
|
||||
this.statusCodeSuccess = 200;
|
||||
|
||||
Reference in New Issue
Block a user