Total Complexity | 1 |
Total Lines | 17 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | |||
13 | @ns.route('/new') |
||
14 | @api.response(404, 'Validation error', message) |
||
15 | class CommentItemNew(Resource): |
||
16 | |||
17 | @api.expect(authorization, comment_new) |
||
18 | @api.marshal_with(message, 'Success') |
||
19 | @api.response(400, 'No results found', message) |
||
20 | def put(self): |
||
21 | """ |
||
22 | Create a comment item. |
||
23 | * Privileges required: **edit** |
||
24 | """ |
||
25 | validate_privilege(self, 'edit') |
||
26 | user_id = select_userid_jwt(self) |
||
27 | data = request.json |
||
28 | result = new_comment_item(user_id, data) |
||
29 | return result, 200, security_headers() |
||
30 | |||
31 |