hngprojects / hng_boilerplate_python_fastapi_web

Apache License 2.0
154 stars 137 forks source link

feat: fixed duplicate timezones #954

Closed theijhay closed 3 weeks ago

theijhay commented 3 weeks ago

Description

This update addresses an issue where duplicate time zone entries appeared in the dropdown menu on the Language & Region settings page of the Admin Dashboard. The service logic has been refactored to ensure that only unique time zones are retrieved and displayed in the dropdown.

Related Issue (Link to issue ticket)

This pull request resolves the issue related to duplicate time zone entries in the dropdown, as tracked in issue #943

Motivation and Context

The change was necessary to eliminate confusion among users when selecting a time zone from the dropdown. Duplicates in the list could lead to errors or user frustration. By ensuring each time zone is listed only once, the user experience is improved, and potential errors are reduced.

How Has This Been Tested?

The changes were tested using Postman to verify the api/v1/regions/ endpoint returns only unique time zones without duplicates. The testing included querying the database to ensure that the list is comprehensive and accurate

Screenshots (if appropriate - Postman, etc):

Screenshot from 2024-08-24 12-37-36

Types of changes

Checklist:

theijhay commented 3 weeks ago

Where are the tests Johnson requested for?

@joboy-dev This is just a fix, and perhaps there is no test for regions endpoints, the person didn't write it. and you want me to write test for all these endpoints?