From 68a4cc597f4da5bcd507c182e936683e426b0709 Mon Sep 17 00:00:00 2001 From: Ildar Kamalov Date: Wed, 22 May 2019 18:28:16 +0300 Subject: [PATCH] * client: fix sort helper --- client/src/helpers/helpers.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/client/src/helpers/helpers.js b/client/src/helpers/helpers.js index 773b54f9..031747f3 100644 --- a/client/src/helpers/helpers.js +++ b/client/src/helpers/helpers.js @@ -213,15 +213,14 @@ export const sortClients = (clients) => { const compare = (a, b) => { const nameA = a.name.toUpperCase(); const nameB = b.name.toUpperCase(); - let comparison = 0; if (nameA > nameB) { - comparison = 1; + return 1; } else if (nameA < nameB) { - comparison = -1; + return -1; } - return comparison; + return 0; }; return clients.sort(compare);