mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-20 08:33:11 +00:00
refactor: use constructor for checking error type in SCRoute
change SCRouteHttpVerbs from type to enum
This commit is contained in:
@@ -12,8 +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 {SCMessage} from '../../../things/Message';
|
||||
import {
|
||||
SCInternalServerErrorResponse,
|
||||
SCMethodNotAllowedErrorResponse,
|
||||
SCSyntaxErrorResponse,
|
||||
SCUnsupportedMediaTypeErrorResponse,
|
||||
SCValidationErrorResponse,
|
||||
} from '../../errors/ErrorResponse';
|
||||
|
||||
/**
|
||||
* User feedback
|
||||
@@ -34,13 +41,13 @@ export class SCFeedbackRoute 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 = 'SCFeedbackRequest';
|
||||
this.responseBodyName = 'SCFeedbackResponse';
|
||||
this.statusCodeSuccess = 204;
|
||||
|
||||
Reference in New Issue
Block a user