ita-social-projects / GreenCity

The main aim of “GreenCity” project is to teach people in a playful and challenging way to have an eco-friendly lifestyle. A user can view on the map places that have some eco-initiatives or suggest discounts for being environmentally aware (for instance, coffee shops that give a discount if a customer comes with their own cup). А user can start doing an environment-friendly habit and track their progress with a habit tracker.
MIT License
66 stars 80 forks source link

API [Edit event] Status code 200 is shown when user enters the same time in "Start time" and "End time" fields in 1 day duration event #7219

Closed Maryna-511750 closed 4 weeks ago

Maryna-511750 commented 3 months ago

Environment: Windows 11 Pro, Google Chrome (126.0.6478.56), Postman Reproducible: always. Build found: 14.06.2024

Preconditions The user is authorized The user has one created event
 Postman is opened and the token is gotten.

Steps to reproduce Create a PUT request to https://greencity.greencity.social/events/update 
Body: { "id": "2", "title": "Some title", "description": "

Some description. A very long description of the event.

", "open": true, "tags": [ "Economic" ], "datesLocations": [ { "startDate": "2024-06-25T13:00:00.000Z", "finishDate": "2024-06-25T13:00:00.000Z", "onlineLink": "https://github.com/ita-social-projects/GreenCity/projects/3" } ], "imagesToDelete": [], "additionalImages": [], "titleImage": "img/habits/default-habit-image.png" }

Actual result Status: 200 OK

Expected result Status: 400 Bad Request

Roksana77 commented 4 weeks ago

The bug is not reproducible for Chrome 127.0.6533.100 (64-bit).

image

Roksana77 commented 4 weeks ago

image