feat: Add a sort option for conversations waiting for a reply from an agent (#7364)

This commit is contained in:
Pranav Raj S
2023-06-21 13:20:39 -07:00
committed by GitHub
parent e6a49b5800
commit 93daaea19b
15 changed files with 166 additions and 39 deletions

View File

@@ -29,5 +29,13 @@ module SortHandler
)
)
end
def self.sort_on_waiting_since
order(
Arel::Nodes::SqlLiteral.new(
sanitize_sql_for_order('CASE WHEN waiting_since IS NULL THEN now() ELSE waiting_since END ASC, created_at ASC')
)
)
end
end
end