StreetCode icon indicating copy to clipboard operation
StreetCode copied to clipboard

[API][Art Gallery Block] Admin can create Art Gallery slides with any (streetcodeArtSlides and StreetcodeArts) Index value

Open ChornaOksana opened this issue 7 months ago • 0 comments

Environment: Windows 10 Home, Google Chrome 124.0.6367.209. Reproducible: always Build found: eca9b63

Preconditions: Open Postman.

  1. Choose the POST method.
  2. Enter valid endpoints.

Steps to reproduce:

  1. Fill in all mandatory keys for creating Streetcode

  2. Fill in Art Gallery block with 2 or more slides. Assign each slide index and art index any random value Example of request: { "firstName": "string",
    "lastName": "string",
    "index": 250,
    "teaser": "string",
    "dateString": "7(18) лютого 2025",
    "alias": "string",
    "status": 1,
    "streetcodeType": 1,
    "title": "Сергій Жадан",
    "transliterationUrl": "sergiit500-zhadan11",
    "eventStartOrPersonBirthDate": "2025-02-21T09:01:38.422Z",
    "eventEndOrPersonDeathDate": "2025-02-21T09:01:38.422Z",
    "toponyms": [],
    "timelineItems": [],
    "imagesDetails": [ { "id": 0, "title": "string", "alt": "1", "imageId": 19704 } ], "streetcodeArtSlides": [

    { "index": 5, "streetcodeArts": [ { "index": 2, "artId": 0 }, { "index": 0, "artId": 1 }, { "index": 6, "artId": 2 } ], "streetcodeId": 0, "template": 1, "modelState": 0 }, { "index": 13, "streetcodeArts": [ { "index": 3, "artId": 3 }, { "index": 4, "artId": 4 }, { "index": 5, "artId": 5 } ], "streetcodeId": 0, "template": 9, "modelState": 0 } ], "arts": [ { "id": 0, "imageId": 19705, "description": "", "title": "", "modelState": 0 }, { "id": 1, "imageId": 19706, "description": "string", "title": "string", "modelState": 0 }, { "id": 2, "imageId": 19707, "description": "string", "title": "string", "modelState": 0 }, { "id": 3, "imageId": 19708, "description": "string", "title": "string", "modelState": 0 }, { "id": 4, "imageId": 19709, "description": "string", "title": "string", "modelState": 0 }, { "id": 5, "imageId": 19710, "description": "string", "title": "string", "modelState": 0 } ], "arBlockURL": null, "viewCount": 0, "text": null, "audioId": null, "imagesIds": [ 19704 ], "tags": [], "subtitles": [ { "subtitleText": "string" } ], "facts": [], "videos": [], "relatedFigures": [], "partners": [], "streetcodeCategoryContents": [], "coordinates": [], "statisticRecords": [] }

Actual result: Response 200ok, historycode is created. Slides and arts are displayed in ascending order (2, 15, 30)

Expected result:

  1. Incorrect slide indexes (streetcodeArtSlides). Response 400 Bad Request. Historycode isn`t created. Message "Некоректні значення index слайдів Арт Галареї" appears. Index of slides should be related to SlideId. So, if we have only 3 slides, there are possible only such values of Index as "0", "1", "2". They though can be in any order in requst but displayed only in ascending order on the site
  2. Incorrect art indexes (streetcodeArts). Response 400 Bad Request. Historycode isn`t created. Message "Некоректні значення index артів Арт Галареї". If there are only 3 arts, only such values of Index as "0", "1", "2" are possible. They though can be in any order in requst but displayed only in ascending order on the site

Image

User story: https://github.com/ita-social-projects/StreetCode/issues/127

ChornaOksana avatar Apr 18 '25 09:04 ChornaOksana