From afc0ee7c43e5495bc559c9bc3b4f908db0b9f18b Mon Sep 17 00:00:00 2001 From: Sharyn Date: Tue, 10 Jul 2018 13:43:25 +0200 Subject: [PATCH] Sorting search results alphabetically --- components/searchResults/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/searchResults/index.js b/components/searchResults/index.js index 50e85e1..b1f193f 100644 --- a/components/searchResults/index.js +++ b/components/searchResults/index.js @@ -7,10 +7,13 @@ const SearchResults = (props) => { return
Loading...
; } + // sort array alphabetically + const sortedInterviews = props.data.sort((a, b) => { return a.name.localeCompare(b.name); }); + return (