ita-social-projects / StreetCode

MIT License
19 stars 9 forks source link

[API] [Admin/StreetCode/Partners] It is not possible to add a partner to a StreetCode using only the partner's ID #1330

Open SophiaMRI opened 7 months ago

SophiaMRI commented 7 months ago

Environment: All Reproducible: Always Build found: a7d807f

Preconditions

  1. Open Postman.
  2. Choose the POST/PUT method.
  3. Enter valid endpoints.

Steps to reproduce

  1. Enter the valid and required data in the body ("index", "title", "streetcodeType", "eventStartOrPersonBirthDate", "teaser" and "imagesIds&imagesDetails").
  2. Add an existing partner to the body using partner's id in the array ( e.g. "partners": [31, 32, 41], ).

Actual result The response returns a '400 Bad Request' status, along with the message 'One or more validation errors occurred.'. The StreetCode has not been created. partners id partners id 200

Expected result The response returns a '201 Created' status. The StreetCode has been created.

User story and test case links User story #499 [Test case] #1315

mozhaieva commented 1 month ago

According to the swagger documentation, if we use the optional 'Partners' field, we must add not only the 'id', but also a 'title': "partners": [ { "id": 0, "title": "string" }