Added the ability to sort by price, capacity, and distance to user. Since there is no option to filter by distance, I made it so that after each change of location the list is filtered by distance. Trucks that failed to calculate the distance are not displayed in the list.
In the getAllOpenedWithTrucks method of shift.repository, I used a nested query to get an array of trucks by 'Active' status. Instead I can do filtering of the result by that status. I don't know which option is better, hope you can advise.
UPD. Created a separate Autocomplete component to avoid using the @react-google-maps/api library, replaced it in location-input.tsx so the functionality in the application is unchanged.
Added the ability to sort by price, capacity, and distance to user. Since there is no option to filter by distance, I made it so that after each change of location the list is filtered by distance. Trucks that failed to calculate the distance are not displayed in the list.
In the
getAllOpenedWithTrucks
method ofshift.repository
, I used a nested query to get an array of trucks by 'Active' status. Instead I can do filtering of the result by that status. I don't know which option is better, hope you can advise.UPD. Created a separate Autocomplete component to avoid using the
@react-google-maps/api
library, replaced it in location-input.tsx so the functionality in the application is unchanged.