Mohammed Foud commited on
Commit
24503bb
·
1 Parent(s): 4dda124
Files changed (1) hide show
  1. src/bots/utils/keyboardUtils.ts +2 -1
src/bots/utils/keyboardUtils.ts CHANGED
@@ -43,10 +43,11 @@ export const getServicesKeyboard = (page: number = 0, sortBy?: 'az' | 'za') => {
43
  const rowSize = 2; // 2 buttons per row
44
  const servicesPerPage = 20;
45
 
46
-
47
  // Apply sorting for all services first
48
  let sortedServices = [...services];
49
  if (sortBy === 'az') {
 
50
  sortedServices.sort((a, b) => a[1].label_en.localeCompare(b[1].label_en));
51
  } else if (sortBy === 'za') {
52
  sortedServices.sort((a, b) => b[1].label_en.localeCompare(a[1].label_en));
 
43
  const rowSize = 2; // 2 buttons per row
44
  const servicesPerPage = 20;
45
 
46
+
47
  // Apply sorting for all services first
48
  let sortedServices = [...services];
49
  if (sortBy === 'az') {
50
+
51
  sortedServices.sort((a, b) => a[1].label_en.localeCompare(b[1].label_en));
52
  } else if (sortBy === 'za') {
53
  sortedServices.sort((a, b) => b[1].label_en.localeCompare(a[1].label_en));