viraxslot / online-school-app

Backend for testing purposes.
0 stars 0 forks source link

Course creation: validation errors return to student role instead of 403 error #42

Closed plushkinaaa closed 2 years ago

plushkinaaa commented 2 years ago

Steps to reproduce

  1. Authorize by student role
  2. Send post request http://qa-school-test.quantori.academy/api/v1/courses without body

Actual behavior

{
    "errors": [
        {
            "msg": "Please send required fields: title",
            "param": "title",
            "location": "body"
        },
        {
            "msg": "Parameter should be a string",
            "param": "title",
            "location": "body"
        },
        {
            "msg": "Minimum category length is: 3",
            "param": "title",
            "location": "body"
        },
        {
            "msg": "Only RU/EN alphabet, space and digits allowed, please change your request",
            "param": "title",
            "location": "body"
        },
        {
            "msg": "You are not allowed to use spaces only",
            "param": "title",
            "location": "body"
        }
    ]
}

Expected behavior

{
    "errors": "This action is forbidden for role student"
}
viraxslot commented 2 years ago

Same reason as here https://github.com/viraxslot/online-school-app/issues/41 I'd close this issue.