1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-02-19 13:54:25 +01:00

(fix) api/products/index bug when sorting by amount

This commit is contained in:
Nicolas Florentin 2023-10-30 10:45:52 +01:00
parent 2b9cb8ca96
commit 910bdcb080
2 changed files with 2 additions and 1 deletions

View File

@ -8,6 +8,7 @@
- improvement: add including_deleted_users param for open api users
- decreases sidekiq concurrency from 25 to 5, 25 is too much and consumes memory for nothing
- do not log Notifications#polling action anymore, by default, can be enable via env variable ENABLE_NOTIFICATIONS_POLLING_LOGGING=true
- Fix a bug: api/products/index bug when sorting by amount
## v6.2.0 2023 October 13

View File

@ -173,7 +173,7 @@ class ProductService
order ||= 'desc'
if key == 'amount'
products.order("COALESCE(amount, 0) #{order.upcase}")
products.order(Arel.sql("COALESCE(amount, 0) #{order.upcase}"))
else
products.order(key => order)
end